I have a workbook with an Index. The index is Dynamic. If I add a new sheet, the index grows. If I change a sheet's visibility to xlSheetVeryHidden, It is removed from the index. Each entry in the list is also a hyperlink to each sheet in the workbook. It is done with Worksheet Activate so It will update any time I go Back to the index. This works fine.
I have tried, and failed miserably to add conditional formatting to the hyperlinked cells in the index. I would like the cells to turn yellow if the date in cell D1 on each sheet in the index is 1 year old. Turn red if it is over 2 years old. I cannot even find an example of this on the internet.
I have also tried to add a second column to the index with Just the date from cell D1 to correspond with the hyperlink in column 2. This way I can add the Conditional formatting to that column. Total failure with this as well.
I hope someone can help me figure this out.
Thank you very much in advance,
Jim
Here is the code on the Index Sheet.
I have tried, and failed miserably to add conditional formatting to the hyperlinked cells in the index. I would like the cells to turn yellow if the date in cell D1 on each sheet in the index is 1 year old. Turn red if it is over 2 years old. I cannot even find an example of this on the internet.
I have also tried to add a second column to the index with Just the date from cell D1 to correspond with the hyperlink in column 2. This way I can add the Conditional formatting to that column. Total failure with this as well.
I hope someone can help me figure this out.
Thank you very much in advance,
Jim
Here is the code on the Index Sheet.
VBA Code:
Private Sub Worksheet_Activate()
Dim sht As Worksheet
Dim TOCsht As Worksheet
Dim RowNo As Integer
Set TOCsht = Sheet29
TOCsht.Unprotect Password:="Password"
TOCsht.Cells.Clear
With TOCsht.Cells(1, 2)
.Value = "Index"
.Font.Bold = True
.Font.Size = 20
.HorizontalAlignment = xlCenter
End With
RowNo = 1
For Each sht In ThisWorkbook.Worksheets
If sht.CodeName <> "Sheet29" And sht.Visible <> xlSheetVeryHidden Then
RowNo = RowNo + 1
TOCsht.Cells(RowNo, 2).Hyperlinks.Add _
Anchor:=Cells(RowNo, 2), _
Address:="", SubAddress:="'" & sht.Name & "'!F6", _
ScreenTip:="", _
TextToDisplay:=sht.Name
End If
Next sht
Dim r As Range, c As Range
Set r = Range(Range("B2"), Range("B2").End(xlDown))
For Each c In r
With c.Font
.Size = 12
End With
Next
End Sub