Creating a cell that returns a date when others are modified

beats_86

New Member
Joined
Apr 6, 2011
Messages
3
Gday,
I have a calendar type spreadsheet that has a series of sheets in it, one for each month of the year. At the bottom of each sheet is a cell displaying "Correct as:" and then a date. Is there a way to make the date cell update whenever someone changes data on any of the sheets?

Currently I have the dates update of a master sheet, being january, but I have to update that master date manually.
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
When you make a change to any sheet that has a cell (any cell) that starts with "Correct As:", the macro below will add or update the date e.g.
Correct as: Apr-06-2011

To install the macro...
  • Right-click on the Excel icon in the upper left
  • Select View Code from the pop-up menu
  • Paste the code below in the VBA edit window
  • This code should go in the Thisworkbook module

Code:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)

    Dim rng As Range
    
    Set rng = Sh.Cells.Find("Correct as:*", , , xlWhole, , , False)
    
    If Not rng Is Nothing Then
        If Intersect(Target, rng) Is Nothing Then
            Application.EnableEvents = False
            rng.Value = "Correct as: " & Format(Date, [COLOR="Red"]"mmm-dd-yyyy"[/COLOR])
            Application.EnableEvents = True
        End If
    End If
    
End Sub

The date format you want to display is in Red.
If the macro can't find a cell on the sheet that starts with "Correct as:" then it does nothing to that sheet.
 
Last edited:
Upvote 0
Thanks for that. Is there any way to make it update the other sheets when one sheet gets updated (eg if I change something in the April sheet, it updates all the other sheets too)?
 
Upvote 0
I would suggest that All the sheets from February to December have their Change As: cells have a formula something like this...
=January!C10

Then the macro below updates only cell C10 on sheet January when a change happens to any sheet.. The formulas on the other sheets will get their dates from January cell C10 (or what ever cell you want).

Code:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)

Application.EnableEvents = False
Sheets("[COLOR="Red"]January[/COLOR]").Range("[COLOR="Red"]C10[/COLOR]").Value = "Correct as: " & Format(Date, "mmm-dd-yyyy")
Application.EnableEvents = True
    
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,726
Members
452,939
Latest member
WCrawford

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top