Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What's the proper way to check and see if a specific
sheet exits in the workbook? I need to pull data from this sheet IF it exists...and if it doesn't exist I need to pull data from another sheet I know will be there... If "Multi-Acct Summary" exists then GetDataFromMultiAccount Else GetDataFromSingleAccount End if Thanks!!! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sean,
Use a function like Function SheetExists(SheetName As String) As Boolean On Error Resume Next SheetExists = CBool(Len(ThisWorkbook.Worksheets(SheetName).Name) ) End Function Then, you can call this with code like If SheetExists("Sheet1") = True Then ' do something Else ' do something else End If -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Sean Evanovich" wrote in message ... What's the proper way to check and see if a specific sheet exits in the workbook? I need to pull data from this sheet IF it exists...and if it doesn't exist I need to pull data from another sheet I know will be there... If "Multi-Acct Summary" exists then GetDataFromMultiAccount Else GetDataFromSingleAccount End if Thanks!!! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this. If sheet 22 does not exist it gets info from sheet 2.
Sub getifthere() On Error Resume Next MsgBox Sheets("Sheet22").Range("c5") MsgBox Sheets("Sheet2").Range("c5") End Sub -- Don Guillett SalesAid Software "Sean Evanovich" wrote in message ... What's the proper way to check and see if a specific sheet exits in the workbook? I need to pull data from this sheet IF it exists...and if it doesn't exist I need to pull data from another sheet I know will be there... If "Multi-Acct Summary" exists then GetDataFromMultiAccount Else GetDataFromSingleAccount End if Thanks!!! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Want a trace a same values exist in two different sheet | Excel Worksheet Functions | |||
verify if spesific sheet exist | Excel Discussion (Misc queries) | |||
VBA: Make a new sheet if it doesn't exist | Excel Discussion (Misc queries) | |||
VBA, Make a new sheet if it doesn't exist | Excel Discussion (Misc queries) | |||
Am I Looking For Something That Doesn't Exist? | Excel Discussion (Misc queries) |