I have a number of named ranged on a worksheet, some are just once cell and others consist of a number of cells.
I have been trying to use the following code to loop through each named range, but I cannot seem to get it to work.
Any comments would be appreciated.
Thanks
I have been trying to use the following code to loop through each named range, but I cannot seem to get it to work.
Code:
Dim rngCheck As Range
Dim wsSheet As Worksheet
'On Error GoTo EH
If ActiveWorkbook.Name = "North Bank Control Sheet Template.xls" Then
Set wsSheet = Sheets("Control Sheet")
For Each rngCheck In wsSheet
If rngCheck = "" Then
Else
MsgBox ("Data present")
'do something here as there is data in worksheet
End If
Next
Else
End If
'Exit Sub
'EH:
'MsgBox (Err.Description)
End Sub
Thanks