I want to know if a cell contains the 1) existing worksheet name 2) is empty.
If both conditions are NOT satisfied(meaning the cell is not empty and contains a unique worksheet name), then an action will take place.
Here is my code which contains some errors
Please look at the code and tell the mistake
If both conditions are NOT satisfied(meaning the cell is not empty and contains a unique worksheet name), then an action will take place.
Here is my code which contains some errors
Code:
Dim ws As Worksheet
For Each ws In Worksheets
If Range("a1").Value = ws.Name Then
MsgBox "exists already"
End If
Next ws
If IsEmpty(Range("a1")) Then
MsgBox "cell empty"
Else
' action statement here
End If