Here are two modules, one for the sheet named "Index" that will list all other sheets in col A and date of last change in col B, and the another for Thisworkbook that will date stamp changes made to any sheet other than the Index sheet. The date stamp in this code goes into cell N1, but you can change that to any cell you wish. Cell A1 of each sheet will have a return link to the Index sheet, but you can use any other cell you wish.
The first code goes into the index sheet.
To install the code:
1. Right-click the worksheet tab you want to apply it to and choose 'View Code'. This will open the VBE window.
2. Copy the code below from your browser window and paste it into the white space in the VBE window.
3. Close the VBE window and Save the workbook. If you are using Excel 2007 or a later version do a SaveAs and save it as a macro-enabled workbook (.xlsm file extension).
4. Make sure you have enabled macros whenever you open the file or the code will not run.
Code:
Private Sub Worksheet_Activate()
Dim wSheet As Worksheet
Dim n As Integer
Dim calcState As Long, scrUpdateState As Long
Dim LastCellChanged As String
calcState = Application.Calculation
Application.Calculation = xlCalculationManual
scrUpdateState = Application.ScreenUpdating
Application.ScreenUpdating = False
n = 1
With Me
.Columns(1).ClearContents
.Cells(1, 1) = "INDEX"
.Cells(1, 1).Name = "Index"
.Cells(1, 2).Value = "Last Cell Changed"
End With
For Each wSheet In Worksheets
If wSheet.Name <> Me.Name Then
LastCellChanged = wSheet.Range("N1").Value
n = n + 1
With wSheet
.Range("A1").Name = "Start_" & wSheet.Index 'Change return link cell to suit here and next line
.Hyperlinks.Add Anchor:=.Range("A1"), Address:="", _
SubAddress:="Index", TextToDisplay:="Back to Index"
End With
Me.Hyperlinks.Add Anchor:=Me.Cells(n, 1), Address:="", _
SubAddress:="Start_" & wSheet.Index, TextToDisplay:=wSheet.Name
Me.Cells(n, 2).Value = LastCellChanged
End If
Next wSheet
Me.Columns("A:B").AutoFit
Application.Calculation = calcState
Application.ScreenUpdating = scrUpdateState
End Sub
The code below goes into Thisworkbook.
To install the code:
1. With your workbook active press Alt and F11 keys. This will open the VBE window.
2. In the project tree on the left of the VBE window, find your project and double-click the 'Thisworkbook' icon.
3. Copy the code below from your browser window and paste it into the white space in the VBE window.
4. Close the VBE window and Save the workbook. If you are using Excel 2007 or a later version do a SaveAs and save it as a macro-enabled workbook (.xlsm file extension).
5. Make sure you have enabled macros whenever you open the file or the code will not run.
Code:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Sh.Name = "Index" Then Exit Sub
If Target.Address = "$A$1" Then Exit Sub
Application.EnableEvents = False
Sh.Range("N1").Value = Now 'Change the cell where last cell change time will be stored to suit
Application.EnableEvents = True
End Sub