+ Reply to Thread
Results 1 to 4 of 4

vba event - change within a sheet triggered by reference

  1. #1
    Registered User
    Join Date
    03-16-2021
    Location
    Germany
    MS-Off Ver
    O365
    Posts
    26

    Smile vba event - change within a sheet triggered by reference

    Hello all,

    I'm afraid, being a non native speaker I didn't find a suitable title and I might not be able to explain my goal on the first try.

    I have several sheets in my workbook (the example has only two which is enough to show my problem, I hope).
    When I change the year in D10 on the first sheet, it will change the values in column B and the year is referenced on all following sheets which are designated as month.
    Cells are colored when it's a working day and non colored during holidays, vacation and weekends.
    As the year is only referenced on every other month from the first sheet I used the "calculate" event to trigger my code.
    So far so good.

    Now to the one thing I can't solve myself right now: I only want to trigger the process on all sheets after the first one, when the D10 cell is changed and no other. But I can't figure out how to do that.
    Maybe a different approach would be better, so I'm open to suggestions.

    Sadly my vba knowledge is quit limited, so the code is rather crude. I have search for possible solutions before posting here, but I've either not found a fitting solution or was unable to adapt my code.

    Best,
    Edward
    Attached Files Attached Files
    Last edited by Edward Hyde; 03-18-2021 at 03:47 AM. Reason: Problem Solved

  2. #2
    Valued Forum Contributor
    Join Date
    09-30-2018
    Location
    Vlaams Brabant Belgium
    MS-Off Ver
    365
    Posts
    456

    Re: vba event - change within a sheet triggered by reference

    Hi Edward,

    I changed it to be more compact

    in a new module put this

    Please Login or Register  to view this content.
    in the January sheet code area put


    Please Login or Register  to view this content.
    Please be as complete as possible in your asking so it may save use all the time to rework the solution because you didn't give all the requirements. If you have a layout in mind please work it out first so we can adapt our solution to it. Thanks.
    If you have been helped, maybe you could click the *

  3. #3
    Valued Forum Contributor
    Join Date
    09-30-2018
    Location
    Vlaams Brabant Belgium
    MS-Off Ver
    365
    Posts
    456

    Re: vba event - change within a sheet triggered by reference

    Workbook with macro inside


    Add ColorData "March" to the january code under ColorData "February" and so on, sheetname must exits in order to work
    Last edited by Joske920; 03-17-2021 at 03:06 PM.

  4. #4
    Registered User
    Join Date
    03-16-2021
    Location
    Germany
    MS-Off Ver
    O365
    Posts
    26

    Re: vba event - change within a sheet triggered by reference

    Quote Originally Posted by Joske920 View Post
    Workbook with macro inside


    Add ColorData "March" to the january code under ColorData "February" and so on, sheetname must exits in order to work
    Thank you very much.
    I have already marked the thread as solved and will implement the solution a bit later today.

    Additional thanks for "trimming it down". The code I have produced is salvaged and adapted from different solutions I have found during my search on the internet and additionally using the macro editor.

    Best,
    Edward
    Last edited by Edward Hyde; 03-18-2021 at 06:21 AM. Reason: Made it easier to read

+ 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] Combobox change event triggered by vba copy on a different page?
    By brucemc777 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-29-2015, 02:11 PM
  2. ComboBox: Change Selected Value when Event is Triggered
    By Agimcomas in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-30-2012, 01:26 PM
  3. Event triggered when renaming sheet?
    By twd000 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 09-29-2008, 08:18 PM
  4. ComboBox Change event triggered incorrectly?
    By Vindaloo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-28-2006, 11:48 AM
  5. [SOLVED] event triggered by cell format change?
    By Stefi in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-10-2006, 08:40 AM
  6. [SOLVED] Change event triggered by a named range
    By Sean in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-31-2005, 10:05 PM
  7. [SOLVED] Event triggered by cell data change/entry
    By Fred Holmes in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-17-2005, 11:06 AM

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