+ Reply to Thread
Results 1 to 12 of 12

Replicate dates

  1. #1
    Forum Contributor
    Join Date
    12-02-2008
    Location
    Brisbane
    MS-Off Ver
    2016
    Posts
    807

    Replicate dates

    I have a workbook with ten sheets. The front sheet is a summary with nine divisional data sheets (DDS) following. In every sheet cell G12 has the date. At the moment the DDS reference the summary sheet and pick up the same date from it. Is it possible to set it up so that if I change the date in cell G12 on any of the sheets I can get them to all read the same?
    Last edited by BRISBANEBOB; 02-16-2009 at 03:09 AM.

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Replicate dates

    Hi Bob,

    This code may work for you. Add it to the ThisWorkbook module. It checks for incorrect data being entered (e.g. non-date value) and handles it by telling the user they've entered incorrect data and then un-doing that last entry.
    Please Login or Register  to view this content.
    Hope that helps!
    Last edited by Paul; 02-16-2009 at 01:06 AM.

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Replicate dates

    You know how to do it on one sheet and use simple cross references on the other sheets, right?

    =Sheet1!G19


    Put that into the other 9 sheets and they will automatically change when you change sheet1.

    Now, I know you want to be able to change it from any sheet, so in the Worksheet Module for the other 9 sheets, put this macro:
    Please Login or Register  to view this content.
    If you type a date into THOSE sheets, it will move that value to sheet1 and put the formula back into the cell you typed in.
    Last edited by JBeaucaire; 02-16-2009 at 01:17 AM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Replicate dates

    Sorry, cleaned up the code a little, forgot to turn off the AppEvents:
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    12-02-2008
    Location
    Brisbane
    MS-Off Ver
    2016
    Posts
    807

    Re: Replicate dates

    Hi

    Absolutely nothing is happening if I change the date in, say, Sheet 6 (except that the data in Sheet 6 changes). The dates in all the other sheets in Cell G19 remain the as Sheet 1 has it. I have checked that macros are enabled and that calc is set to automatic. What else could I be doing wrong? I have also tried setting the cells via data>validation to a list with 'approved' dates but that made no difference.

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Replicate dates

    Hehe, I gave you the code, I even put it in the first couple of sheets. Now you need to put it in the rest of the sheets you want it active in.

    Also, I put it in Sheet1 and it should NOT be there, so be sure to take it out.

    Alt-F11 to open the Editor...

  7. #7
    Forum Contributor
    Join Date
    12-02-2008
    Location
    Brisbane
    MS-Off Ver
    2016
    Posts
    807

    Re: Replicate dates

    Latest: stop press!

    I used the code from Paul and that seems to work fine.

    Thanks very much for the assistance guys, it's very much appreciated.

  8. #8
    Forum Contributor
    Join Date
    12-02-2008
    Location
    Brisbane
    MS-Off Ver
    2016
    Posts
    807

    Re: Replicate dates

    JB

    I'm trying to use your code in a new worksheet but it doesn't seem to syncronise the dates. I'm trying to understand how it works and it all seems to make sense, but still no action...

    What can I be doing wrong? Should I have any special settings anywhere?

  9. #9
    Forum Contributor
    Join Date
    12-02-2008
    Location
    Brisbane
    MS-Off Ver
    2016
    Posts
    807

    Re: Replicate dates

    Paul

    How would I restrict the use of your code to a number of sheets, but not all?

    Thanks

  10. #10
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Replicate dates

    Quote Originally Posted by BRISBANEBOB View Post
    Paul

    How would I restrict the use of your code to a number of sheets, but not all?

    Thanks
    This is why I used the worksheet_ change so you could simply add it into the sheets you want it active in.

    Alt-F11
    Double-click Sheet2 and paste in the code, close the small window
    Double-click Sheet3 and paste in the code, close the small window...
    Repeat only on the sheets you want the code to work in.

    My code watches cell G19, if it changes, it memorizes the change, puts the formula =Sheet1!G19 back into the cell so it is getting its value from the main sheet again, the puts the value it memorized INTO Sheet1!G19 making all sheets update.
    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 02-16-2009 at 02:54 AM.

  11. #11
    Forum Contributor
    Join Date
    12-02-2008
    Location
    Brisbane
    MS-Off Ver
    2016
    Posts
    807

    Re: Replicate dates

    Brilliant! It works! And I understand it!

    Thanks - your assistance is always appreciated.

  12. #12
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Replicate dates

    I commented the code in #10 if you want to use that version, just an option.

    If that takes care of your need, be sure to EDIT your original post (Go Advanced) and mark the PREFIX box [SOLVED]

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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