+ Reply to Thread
Results 1 to 10 of 10

Worksheet Change between two different sheets

  1. #1
    Registered User
    Join Date
    09-12-2008
    Location
    Riversul
    MS-Off Ver
    2016
    Posts
    83

    Question Worksheet Change between two different sheets

    Hello, folks. I've created a macro and I want it to run whenever the value in this cell changes. Well, as an example, I'll take the range A1 for instance, so if I write anything in there, my macro will automatically run. I already have this code, except that it only works if the contents are on the same sheet:

    SHEET 1

    Please Login or Register  to view this content.

    Ok, now what if, for instance, in SHEET 2, A1 cell, I decide to use the following formula:

    Please Login or Register  to view this content.

    Well, even if I apply that same Worksheet_Change code in SHEET 2, that won't really make any difference, after all, although the displayed value will be changed, Excel is gonna say: "Okay buddy, but the formula is still there, that hasn't really changed anything".

    I'd like to know if there's any code that I could use in that same config, in other words, have the value in A1 linked in both sheets, and whenever I change it in SHEET1, the macro will run in my SHEET2. I didn't want to take this turn, but the layout of a sheet doesn't match with the other. Thanks in advance ~

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Worksheet Change between two different sheets

    There is no change event generated when cells change as the result of a formula.

    You could run code in the Calculate event, but it needs to be very efficient code, and if it changes anything in Excel it will kill Undo.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    09-12-2008
    Location
    Riversul
    MS-Off Ver
    2016
    Posts
    83

    Re: Worksheet Change between two different sheets

    Hmm I see, thanks for the feedback shg ~

    In that case, I was actually thinking that whenever I change the value in A1, I can automatically run a macro where I copy the contents of that cell and paste in the other one. I guess that one will do?

  4. #4
    Registered User
    Join Date
    09-12-2008
    Location
    Riversul
    MS-Off Ver
    2016
    Posts
    83

    Re: Worksheet Change between two different sheets

    ... Except that the value in A1 happens to be a validation list cell, and whenever I select anything in there, it doesn't trigger any change

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Worksheet Change between two different sheets

    Data validation of any type doesn't affect triggering the Change event.

  6. #6
    Registered User
    Join Date
    09-12-2008
    Location
    Riversul
    MS-Off Ver
    2016
    Posts
    83

    Re: Worksheet Change between two different sheets

    Hmm... I've found this code while I was searching for answers, except that it only seems to work for a specific amount of choices. Wouldn't there be any way to expand it to any given possibility that is chosen? I mean, whatever value that is selected on the validation list, the macro will run? If it's a no go, I think I'll just give up of this idea. Thanks again, shg ~

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    09-12-2008
    Location
    Riversul
    MS-Off Ver
    2016
    Posts
    83

    Re: Worksheet Change between two different sheets

    Oh... I think I've got it! Thanks for your help, shg!

    Sheet 1

    Please Login or Register  to view this content.

    MacroCopy

    Please Login or Register  to view this content.

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Worksheet Change between two different sheets

    Please Login or Register  to view this content.
    But why use code instead of a simple formula in Sheet2!A1?
    Last edited by shg; 07-31-2017 at 12:39 PM.

  9. #9
    Registered User
    Join Date
    09-12-2008
    Location
    Riversul
    MS-Off Ver
    2016
    Posts
    83

    Re: Worksheet Change between two different sheets

    ... And that, ladies and gentlemen, it's the difference between a VBA newbie and a Forum Guru haha

    Thanks a bunch, that solution worked perfectly!

  10. #10
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Worksheet Change between two different sheets

    You're welcome.

+ 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. [SOLVED] Delete all charts and empty rows from all sheets; won't change sheets
    By astrbac in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-29-2015, 10:12 AM
  2. [SOLVED] How to prevent worksheet change invoking System X Control change event
    By dmw2014 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 09-13-2014, 10:35 PM
  3. Same WorkSheet Change Event Code Across Multiple Sheets Help
    By jaylove in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-03-2014, 06:01 PM
  4. Change this VBA code from Worksheet Change to Worksheet calculate?
    By ExcelFailure in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-26-2013, 04:26 AM
  5. Replies: 7
    Last Post: 11-25-2012, 01:24 AM
  6. Run a Worksheet change macro on two sheets
    By neilshaw2 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 10-11-2011, 04:09 AM
  7. Need to change code that loops all sheets TO exclude some sheets.
    By sherrie777 in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 04-10-2010, 05:29 PM

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