G
Guest
Thanks for taking the time to read my question.
What is the value of w in this case?
For Each w In Worksheets
If DataSheet = w.Name Then
Exit For
Else
If w = Sheets.Count Then
MsgBox "The name entered does not match any sheet in
this workbook. Please try again.", vbCritical, "No Worksheet Found With That
Name"
End If
End If
Next
My code fails at "If w = Sheets.Count then" I'm assuming it's not a number.
I can get w.Name to return a value, but how do I tell what the sheet number
is?
Thanks,
Brad
What is the value of w in this case?
For Each w In Worksheets
If DataSheet = w.Name Then
Exit For
Else
If w = Sheets.Count Then
MsgBox "The name entered does not match any sheet in
this workbook. Please try again.", vbCritical, "No Worksheet Found With That
Name"
End If
End If
Next
My code fails at "If w = Sheets.Count then" I'm assuming it's not a number.
I can get w.Name to return a value, but how do I tell what the sheet number
is?
Thanks,
Brad