Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All......
If someone would be so kind, I would appreciate finding out how to determine is a sheet named "specificsheet" already exists, and if so to switch to it, otherwise to create it and then switch to it...... Thanking you muchly in advance, Vaya con Dios, Chuck, CABGx3 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() On Error Resume Next Set sh = Worksheets("specificsheet") On Erroro Goto 0 If sh Is Nothing then Worksheets.Add.Name = Worksheets("specificsheet") Else sh.ACtivate End If -- HTH RP (remove nothere from the email address if mailing direct) "CLR" wrote in message ... Hi All...... If someone would be so kind, I would appreciate finding out how to determine is a sheet named "specificsheet" already exists, and if so to switch to it, otherwise to create it and then switch to it...... Thanking you muchly in advance, Vaya con Dios, Chuck, CABGx3 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Bob......
After a little massaging, it worked fine in my XL97 (sorry, forgot to mention in original post) Dim sh As Worksheet 'added this line On Error Resume Next Set sh = Worksheets("SpecificSheet") On Error GoTo 0 If sh Is Nothing Then ' Worksheets.Add.Name = Worksheets("SpecificSheet") Worksheets.Add.Name = ("SpecificSheet") 'changed above line Else sh.Activate End If I do appreciate your help,.....I could not have gotten there without it. Vaya con Dios, Chuck, CABGx3 "Bob Phillips" wrote: On Error Resume Next Set sh = Worksheets("specificsheet") On Erroro Goto 0 If sh Is Nothing then Worksheets.Add.Name = Worksheets("specificsheet") Else sh.ACtivate End If -- HTH RP (remove nothere from the email address if mailing direct) "CLR" wrote in message ... Hi All...... If someone would be so kind, I would appreciate finding out how to determine is a sheet named "specificsheet" already exists, and if so to switch to it, otherwise to create it and then switch to it...... Thanking you muchly in advance, Vaya con Dios, Chuck, CABGx3 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "CLR" wrote in message ... Thanks Bob...... After a little massaging, it worked fine in my XL97 (sorry, forgot to mention in original post) ' Worksheets.Add.Name = Worksheets("SpecificSheet") Worksheets.Add.Name = ("SpecificSheet") 'changed above line Really? You surprise me. Going to dig out my old NT4 machine and check this :-) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Create Hyperlink only if file exists | Excel Discussion (Misc queries) | |||
Create Worksheet BUT If It Already Exists... | Excel Discussion (Misc queries) | |||
Test if folder exists, create if it doesn't? | Excel Programming | |||
Test if a folder exists, create if it doesn't? | Excel Programming | |||
How can I know if a sheet exists ? | Excel Programming |