Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i would like to see if a specific worksheet is in a workbook. something
like: If issheet("sheetX") Then 'look up stuff on 'sheetX' Else 'don't look up stuff on 'sheetX' End If i realize "issheet" is wrong, but what would be correct? thanks, mike allen |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Do you mean this Mike
Sub test() If ActiveSheet.Name = "Sheet1" Then MsgBox "Sheet1 is the ActiveSheet" Else MsgBox "Sheet1 is not the ActiveSheet" End If End Sub -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "mike allen" wrote in message ... i would like to see if a specific worksheet is in a workbook. something like: If issheet("sheetX") Then 'look up stuff on 'sheetX' Else 'don't look up stuff on 'sheetX' End If i realize "issheet" is wrong, but what would be correct? thanks, mike allen |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Take a look at John Walkenbach's SheetExists function:
http://www.j-walk.com/ss/excel/tips/tip54.htm You could also do it inline: Dim wkSht As Worksheet On Error Resume Next Set wkSht = Worksheets("SheetX") On Error GoTo 0 If Not wkSht Is Nothing Then 'look up stuff on 'SheetX' Else 'don't look up stuff on 'SheetX' End If In article , "mike allen" wrote: i would like to see if a specific worksheet is in a workbook. something like: If issheet("sheetX") Then 'look up stuff on 'sheetX' Else 'don't look up stuff on 'sheetX' End If i realize "issheet" is wrong, but what would be correct? thanks, mike allen |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
detect when columns being written to a worksheet “cross” a vertical page break | Excel Worksheet Functions | |||
Detect Duplicates | Excel Worksheet Functions | |||
How to detect #N/A and return 0? | Excel Discussion (Misc queries) | |||
How do I detect hidden worksheets or hidden data on a worksheet? | Excel Discussion (Misc queries) | |||
How to detect changes in a column? | Excel Discussion (Misc queries) |