Hi guys,
i thought i was getting the hang of VBA but it continues to trip me up in places!
i have the code below, i thought it would be fairly simple and in my head the code makes sense and should work but there's some VBA quirk that's stopping it. if i change "TestRows" in the following code to a number it works perfectly but i need the value to change based on what "TestRows" equals at any given time. any help is greatly appreciated!
i thought i was getting the hang of VBA but it continues to trip me up in places!
i have the code below, i thought it would be fairly simple and in my head the code makes sense and should work but there's some VBA quirk that's stopping it. if i change "TestRows" in the following code to a number it works perfectly but i need the value to change based on what "TestRows" equals at any given time. any help is greatly appreciated!
VBA Code:
Private Sub HideUnusedRuns_Click()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
For TestRows = 81 To 1007 Step 56
If ActiveSheet.Cells(TestRows + 1, 9).Value = "" Then
ActiveSheet.Range("TestRows: 1032").EntireRow.Hidden = True
End If
Next TestRows
Application.ScreenUpdating = True
MsgBox "Setup sheet updated!", vbOKOnly & vbInformation
Application.Calculation = xlCalculationAutomatic
End Sub