I am writing my first excel Macro so am keen and excited! However, I am having problems with the code. My objective is to first check whether any of the 6 values in cells H2:H7 are present in any of the cells in column B starting from cell B10. I want to hide the rows where the values are not present. This is the code I have come up with but I keep getting various errors. Any help would be much appreciated!!
Sub HideRows()
Dim ISIN As Range
Dim MyRow As Long
Dim MyColumn As Long
Set ISIN = Range("H2:H7")
Set MyRow = 10
Set MyColumn = 2
Worksheets("Product Monitor").Activate
If Cells(MyRow, MyColumn).Value = Not (ISIN) Then
Rows(MyRow).EntireRow.Hidden = True
MyRow = MyRow + 1
End If
End Sub
Bookmarks