Hi Friends,
I have a spreadsheet with staff names which appears multiple times.
I’m trying to create a macro that would hide staff names as per the macro below which only selects the first name and only once.
Sub HURows()
BeginRow = 1
EndRow = 500
ChkCol = 2
For RowCnt = BeginRow To EndRow
If Cells(RowCnt, ChkCol).Value = "Andy", Or “Mike”, or “Tom” Then
Cells(RowCnt, ChkCol).EntireRow.Hidden = True
Else
Cells(RowCnt, ChkCol).EntireRow.Hidden = False
End If
Next RowCnt
End Sub
I have a spreadsheet with staff names which appears multiple times.
I’m trying to create a macro that would hide staff names as per the macro below which only selects the first name and only once.
Sub HURows()
BeginRow = 1
EndRow = 500
ChkCol = 2
For RowCnt = BeginRow To EndRow
If Cells(RowCnt, ChkCol).Value = "Andy", Or “Mike”, or “Tom” Then
Cells(RowCnt, ChkCol).EntireRow.Hidden = True
Else
Cells(RowCnt, ChkCol).EntireRow.Hidden = False
End If
Next RowCnt
End Sub