FadeToOrange
New Member
- Joined
- Feb 26, 2023
- Messages
- 5
- Office Version
- 365
- Platform
- Windows
Hi Everyone,
I'm building a workbook to track and monitor the recruitment plans for several job positions. The workbook has 2 informational sheets 8 sheets for the roles needing to be filled (1 sheet for each of the 8 jobs). In cell A10 of each job sheet is the recruitment start date. I'm trying to create a way to change the color of the job tab to green when that date is within 1 week or less of the date in cell A10. I've poked around on other posts that were similar and attempted the VBA scripts suggested - tweaking to my specs - and have the below script which works if I go into each tab and update the date, but I'd like it to update all the tabs all the time based on the current date. The file usually sits open on my computer and I'm not always updating the individual sheets, but want to be able to see in real time which sheets are "active" (in the recruitment process period) or not.
Option Explicit
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Sh.Range("A10").Value - 7 >= Now() Then
Sh.Tab.ColorIndex = -4142 ' No Color
Else
Sh.Tab.ColorIndex = 10 ' Green
End If
End Sub
Appreciate the help and input.
Mike
I'm building a workbook to track and monitor the recruitment plans for several job positions. The workbook has 2 informational sheets 8 sheets for the roles needing to be filled (1 sheet for each of the 8 jobs). In cell A10 of each job sheet is the recruitment start date. I'm trying to create a way to change the color of the job tab to green when that date is within 1 week or less of the date in cell A10. I've poked around on other posts that were similar and attempted the VBA scripts suggested - tweaking to my specs - and have the below script which works if I go into each tab and update the date, but I'd like it to update all the tabs all the time based on the current date. The file usually sits open on my computer and I'm not always updating the individual sheets, but want to be able to see in real time which sheets are "active" (in the recruitment process period) or not.
Option Explicit
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Sh.Range("A10").Value - 7 >= Now() Then
Sh.Tab.ColorIndex = -4142 ' No Color
Else
Sh.Tab.ColorIndex = 10 ' Green
End If
End Sub
Appreciate the help and input.
Mike