View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
stewdizzle stewdizzle is offline
external usenet poster
 
Posts: 17
Default Using If Then to check for a worksheet

I am creating an add-in for work. When the user opens the Add-in I
want to have code that checks to make sure a specific sheet exists in
the workbook before the addin works. Something to the effect of

If activeWorkbook contains "Sheet1"
Then
Copy "addin"
else
MsgBox "You have the wrong spreadsheet opened"

Can someone help me work out the code?