KlausW
Active Member
- Joined
- Sep 9, 2020
- Messages
- 386
- Office Version
- 2016
- Platform
- Windows
Hi I have a vague plan divided into months, I have tried with this VBA to get the color of the tab as the date you are in now to change the Danish name of the month is in cell E1, but it may not need to happen. The VBA code is in this production's directory, but it's not what's wrong, anyone can help?
All help will be appreciated
Regards Klaus W
VBA Code:
Private Sub Workbook_Open ()
Dim WS As Worksheet
Dim MountNu As String
MountNu = Range ("E1") & WorksheetFumktion.MountNow ()
For Each WS In ThisWorkbook.Worksheets
If WS.Name = MountNu Then
WS.Tab.ColorIndex = 4
Else
WS.Tab.ColorIndex = xlColorIndexNone
End If
Next
End Sub
Regards Klaus W