+ Reply to Thread
Results 1 to 7 of 7

Worksheet change for 2 functions

  1. #1
    Registered User
    Join Date
    07-17-2017
    Location
    London
    MS-Off Ver
    2016
    Posts
    5

    Worksheet change for 2 functions

    Hello,

    I am trying to have a worksheet_change function that

    a) Enter the date a cell was last changed into a specific row and columns

    which I got working.

    now I want to add

    b) a function that if a certain cell has the word YES in it, the message box to add a link to a document should open.

    I have something working on excel 2016 but it gives a not sufficient memory error when running on excel 2010. When I unmark the lines below I get the error on excel 2010. I don't have an excel 2010 on this machine but would like to get rid of this error somehow.

    can anyone help me out?

    Please Login or Register  to view this content.
    Thank you so much

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,705

    Re: Worksheet change for 2 functions

    Your code is changing cells. This will cause your sub to be called again, when it will change cells, and be called again..... So you build up this huge stack and run out of memory.

    Add these two lines as the first and last lines of your sub:

    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    07-17-2017
    Location
    London
    MS-Off Ver
    2016
    Posts
    5

    Re: Worksheet change for 2 functions

    Hi Jeff,

    thanks a lot, do you know why this would work in excel 2016 but not 2010?

    hopefully will work on the 2010 excel i have to get it to run to.

    Edit: Just saw that it seems to run only for one instance now. Once i changed a cell, and the date has been updated, the next change does not lead to the sub running in the background? Could that be?
    When i remove text from a cell, or change it , it also doesnt update the date anymore.

    Any pointers on this?


    Best regards,
    Martin
    Last edited by mahtin360; 07-31-2017 at 06:13 PM.

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,705

    Re: Worksheet change for 2 functions

    I am sure that it is not the version of Excel but rather the amount of memory available in the two different computers.

    Just saw that it seems to run only for one instance now. Once i changed a cell, and the date has been updated, the next change does not lead to the sub running in the background? Could that be?
    When i remove text from a cell, or change it , it also doesnt update the date anymore.
    Can you attach your file? Too many variables for me to guess what you're doing or what could be wrong.

  5. #5
    Registered User
    Join Date
    07-17-2017
    Location
    London
    MS-Off Ver
    2016
    Posts
    5

    Re: Worksheet change for 2 functions

    Hi

    i have attached the file.

    Seems to be with changing cells that already existed now. Cant really figure out how to address this.


    Thank you for looking at it.
    Attached Files Attached Files

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,705

    Re: Worksheet change for 2 functions

    I am not seeing a problem with how this code runs, testing on Excel 2013.

    When i remove text from a cell, or change it , it also doesnt update the date anymore.
    I don't understand what you think the problem is. When you make a change, the macro sets the date in column L to today's date. If you make another change, it still sets it to today's date but of course, it still looks the same.

    What do you see happening, and what do you want to happen?

  7. #7
    Registered User
    Join Date
    07-17-2017
    Location
    London
    MS-Off Ver
    2016
    Posts
    5

    Re: Worksheet change for 2 functions

    Quote Originally Posted by 6StringJazzer View Post

    What do you see happening, and what do you want to happen?
    It works pretty well, I have only noticed that it stops adding the date once i deleted the content of a cell.

    For example when i add content to an empty cell, it will put the date in Column L. If I then delete the content lets say of F6, and go on to write in another empty cell (F20), the date does not appear in column L row 20. I have to then press Update Button, and after that it would be working again until i deleted the content of a non-empty cell.

    Everything else is working fine. Thank your for that little, but very helpful pointer!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Multi worksheet change functions on one page.
    By ace_vfx in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-16-2016, 09:14 AM
  2. Worksheet 1 to Worksheet 2 functions - Super Easy Problem - I just dont know
    By theshark43 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-21-2010, 11:47 AM
  3. [SOLVED] worksheet change infinite loop/calculate for user functions
    By Mike in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-17-2006, 12:30 AM
  4. Worksheet Functions that Change Other Cells
    By Robert Mulroney in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-07-2005, 04:20 AM
  5. [SOLVED] RE: Worksheet Functions that Change Other Cells
    By Jim Thomlinson in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-07-2005, 03:55 AM
  6. worksheet functions change to values? Formula are text?
    By Christy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-31-2005, 05:05 PM
  7. Public Functions As Worksheet Available Functions
    By Steve King in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-12-2005, 04:06 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1