aliaslamy2k
Active Member
- Joined
- Sep 15, 2009
- Messages
- 416
- Office Version
- 2019
- Platform
- Windows
Dear All ,
I am using below VBA code to hide rows if criteria is met, but i am getting " Complie Error; Next without For "
Private Sub Worksheet_Change(ByVal Target As Range)
Dim c
For Each c In Range("B5:B10")
If c = "Jack" Or c = "Molly" Then _
Rows(c.Row).EntireRow.Hidden = True
Next
End Sub
I am using below VBA code to hide rows if criteria is met, but i am getting " Complie Error; Next without For "
Private Sub Worksheet_Change(ByVal Target As Range)
Dim c
For Each c In Range("B5:B10")
If c = "Jack" Or c = "Molly" Then _
Rows(c.Row).EntireRow.Hidden = True
Next
End Sub