Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2004
    Location
    Singapore
    Posts
    28

    Question Unanswered: How to check for a sheet in the workbook?

    Hi,

    How can I check if a sheet is already in the workbook before trying to activate the sheet?

    Please help! Thanks...
    oks

  2. #2
    Join Date
    Feb 2002
    Posts
    8
    The function below should do what you need.
    Dave.

    Function SheetExists(strSheetName As String) As Boolean
    Dim shtTemp As Worksheet
    SheetExists = False
    For Each shtTemp In ActiveWorkbook.Sheets
    If shtTemp.Name = strSheetName Then SheetExists = True
    Next shtTemp
    End Function

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •