nitrammada
Board Regular
- Joined
- Oct 10, 2018
- Messages
- 78
- Office Version
- 365
- Platform
- Windows
Hello Folks,
I have some code that finds the last row of data on my very hidden sheet, rules it off by colouring the last row without data. The code works fine if the sheet is visible, but I have 100's of these sheets that are very hidden. I've tried to run the code on these very hidden sheets but can't get it to run. Is anyone able to help me please? My code is below, if any one can assist i would be most grateful.
Thanks in advance
Regards
Adam
I have some code that finds the last row of data on my very hidden sheet, rules it off by colouring the last row without data. The code works fine if the sheet is visible, but I have 100's of these sheets that are very hidden. I've tried to run the code on these very hidden sheets but can't get it to run. Is anyone able to help me please? My code is below, if any one can assist i would be most grateful.
Thanks in advance
Regards
Adam
VBA Code:
Sub OffsetToAllShts3()
'Colour last row to all sheets
Application.ScreenUpdating = False
Application.EnableEvents = False
ActiveSheet.Unprotect
Dim lWS_Visible_State As Long
Dim ws As Worksheet
'Apply Format to all very hidden sheets
For Each ws In Worksheets
lWS_Visible_State = ws.Visible
ws.Visible = xlSheetVisible
If ws.Range("A1").Value = "L2" Then
Range("D7").End(xlDown).Offset(1, -2).Select
Range(ActiveCell, ActiveCell.Offset(0, 35)).Select
With Selection
.Interior.Color = 14083324
End With
End If
ws.Visible = lWS_Visible_State
Next ws
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub