Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
how would you go about checking to see if a sheet exists
of not? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
One way
(al code in a normal module) Function SheetExists(SName As String, _ Optional ByVal WB As Workbook) As Boolean 'Chip Pearson On Error Resume Next If WB Is Nothing Then Set WB = ThisWorkbook SheetExists = CBool(Len(WB.Sheets(SName).Name)) End Function Use it like this for example Sub Sheet_Test() Dim SName As String If SheetExists("test") = False Then ActiveSheet.Name = "test" Else MsgBox "sorry the sheet exist" End If End Sub -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "Ross" wrote in message ... how would you go about checking to see if a sheet exists of not? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to check to see if a sheet with a particular name exists? | Excel Worksheet Functions | |||
check if sheet exists | Excel Discussion (Misc queries) | |||
Check if file exists | Excel Discussion (Misc queries) | |||
check if the sheet/tag exists | Excel Worksheet Functions | |||
check if worksheet exists | Excel Programming |