View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
AKphidelt AKphidelt is offline
external usenet poster
 
Posts: 461
Default Checking a worksheet is present

Keep in mind, that if Data sheet isn't present, you have to create another
line after the msgbox if you don't want the macro to continue. One way is to
put GoTo NoData

Then right before End Sub

Put the Line NoData: MsgBox("No Data Worksheet")
End Sub

Whatever you like.... theres tons of ways to do it.

"mmc308" wrote:

I have a macro that relies on a worksheet being present, however if the sheet
is missing I need to reply with a message box to tell the person to copy in
the worksheet

If Worksheet ("data") = False Then
MsgBox "You need to copy of the data worksheet."
Else
Continue with Macro
End If

TIA
mmc308