Results 1 to 3 of 3

Detect a worksheet is present in a workbook

Threaded View

  1. #1
    Registered User
    Join Date
    01-13-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2007, Excel 2010
    Posts
    76

    Detect a worksheet is present in a workbook

    Hello,

    I have written a few macro for my Excel template.
    But I want it to run only if the active workbook has sheet named "Table".
    May I know how to write the code properly?

    I know this sentence is wrong, please help me to correct it.
    If Activeworkbook.Sheets("Table"). Is Nothing Then

    Sub Action()
    
    If Activeworkbook.Sheets("Table"). Is Nothing Then 
    MsgBox("Please select the proper workbook.")
    Else
    Call Macro1
    End If
    
    End Sub
    Last edited by Beginner Level; 06-06-2012 at 03:36 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1