The name of the worksheet is specified by the mySheetName variable. ![]() This example shows how to determine if a worksheet named "Sheet4" exists. MsgBox "The sheet named ''" & mySheetName & "'' does NOT exist in this workbook." MsgBox "The sheet named ''" & mySheetName & "'' DOES exist in this workbook." ![]() MySheetNameTest = Worksheets(mySheetName).Name Sub TestSheetYesNo()ĭim mySheetName As String, mySheetNameTest As String This example shows how to determine if a worksheet named "Sheet4" exists by using the Name property of the Worksheet object. ![]() Sample code provided by: Tom Urtis, Atlas Programming Management Determining if a Worksheet Exists The following examples show how to determine if a worksheet exists, and then how to create or replace the worksheet.
0 Comments
Leave a Reply. |