Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Sub gsnu()
Dim w As Worksheet For Each w In Worksheets If w.Name = "trial" Then MsgBox ("worksheet " & w.Name & " already exists") Exit Sub End If Next MsgBox ("worksheet " & "trial" & " does not exist") End Sub -- Gary''s Student " wrote: Hi, Is there a way in Visual basic to check if a worksheet with a specific name exists? If it does not exist, I want to add it and format it; if it does, I just want to format it. Thanks! Brett |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
macro | Excel Discussion (Misc queries) | |||
Asked previously...can this not be done in excel | Excel Discussion (Misc queries) | |||
Compiling macro based on cell values | Excel Discussion (Misc queries) | |||
Using a relative SHEET reference for source data in a chart | Charts and Charting in Excel | |||
Checking if sheet is visible | Excel Discussion (Misc queries) |