I'm an absolute green newby at VBA and I can't seem to get this right. I want to check to see if the selected cell is on a certain row. If so, then I want it to perform a certain routine, and if it's not, then it is to perform a dlfferent routine. For example, these are the rows I want to check: 8, 9, 10, 18, 19, 23, 24, 25, 33, 34, 38, 39, 40, 48, 49.
Sub CheckRow()
Dim rw As Range
For Each rw In Sheets("Sheet1").Range(8, 9, 10, 18, 19, 23, 24, 25, 33, 34, 38, 39, 40, 48, 49).Row
If ActiveCell.Row = rw Then
MsgBox "Yes"
Else
MsgBox "No way"
End If
End Sub
Sub CheckRow()
Dim rw As Range
For Each rw In Sheets("Sheet1").Range(8, 9, 10, 18, 19, 23, 24, 25, 33, 34, 38, 39, 40, 48, 49).Row
If ActiveCell.Row = rw Then
MsgBox "Yes"
Else
MsgBox "No way"
End If
End Sub