ImogenRClark
New Member
- Joined
- Jan 11, 2023
- Messages
- 3
- Office Version
- 365
- Platform
- Windows
Hi everyone
I'm very new to VBA and I'm trying to get my code to run continuously so that every time the excel spread sheet data is updated, it will automatically make the changes without having to manually re-run the code. Here's my code:
Sub Hide_Rows_Based_On_Cell_Value()
StartRow = 2
Dim EndRow As Long
EndRow = Range(“A:A”).SpecialCells(xlCellTypeLastCell).Row
ColNum = 7
For i = StartRow To EndRow
If Cells(i, ColNum).Value <> "Open" And Cells(i, ColNum).Value <> 0 Then
Cells(i, ColNum).EntireRow.Hidden = True
Else
Cells(i, ColNum).EntireRow.Hidden = False
End If
Next i
End Sub
I'm very new to VBA and I'm trying to get my code to run continuously so that every time the excel spread sheet data is updated, it will automatically make the changes without having to manually re-run the code. Here's my code:
Sub Hide_Rows_Based_On_Cell_Value()
StartRow = 2
Dim EndRow As Long
EndRow = Range(“A:A”).SpecialCells(xlCellTypeLastCell).Row
ColNum = 7
For i = StartRow To EndRow
If Cells(i, ColNum).Value <> "Open" And Cells(i, ColNum).Value <> 0 Then
Cells(i, ColNum).EntireRow.Hidden = True
Else
Cells(i, ColNum).EntireRow.Hidden = False
End If
Next i
End Sub