Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Worksheet exists
Is there an easy way to find out if a sheet with a particular name already
exists in a workbook? Thanks, Kaval |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Worksheet exists
One way:
Const sNAME As String = "ParticularName" Dim ws As Worksheet On Error Resume Next Set ws = Worksheets(sNAME) On Error GoTo 0 If Not ws Is Nothing Then MsgBox "Worksheet " & sNAME & " exists" Else MsgBox "Worksheet " & sNAME & " doesn't exist" End If In article , "Kaval" wrote: Is there an easy way to find out if a sheet with a particular name already exists in a workbook? Thanks, Kaval |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Worksheet exists
On Error Resume Next
Sheets("MySheet").Select If Err Then MsgBox "MySheet does not exist" End If On Error GoTo 0 "Kaval" wrote in message ... Is there an easy way to find out if a sheet with a particular name already exists in a workbook? Thanks, Kaval |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Create Worksheet BUT If It Already Exists... | Excel Discussion (Misc queries) | |||
Check if a worksheet exists | Excel Programming | |||
How to check if a worksheet exists in worksheet collection | Excel Programming | |||
Worksheet Exists... | Excel Programming | |||
How can I tell if a worksheet exists? | Excel Programming |