View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
dajns dajns is offline
external usenet poster
 
Posts: 5
Default How to test to see if a given sheet from is in a workbook from

Ron, Thank you very much. I will begin coding asap!
dajns

"Ron de Bruin" wrote:

Hi dajns

You can use this function to test if the sheet exist in your code
If SheetExists("Sheet1") = False Then...................

Function SheetExists(SName As String, _
Optional ByVal wb As Workbook) As Boolean
'Chip Pearson
On Error Resume Next
If wb Is Nothing Then Set wb = ThisWorkbook
SheetExists = CBool(Len(wb.Sheets(SName).Name))
End Function




--
Regards Ron de Bruin
http://www.rondebruin.nl


"dajns" wrote in message ...
I have 200 workbooks that are 80% the same. One worksheet in each is an index
that has checkboxes for printing. I need to verify the presence of the sheet
to print before I issue the print command. Any sugguestions?