Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need to test for the existence of a specific worksheet in the active
workbook. The sheet name will always be "OldFiles" and I need to create it if is doesn't exist. Also, is there a way to make the new sheet ("OldFiles") invisible? Ken |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Ken,
Try: Sub TestIt() If Not SheetExists("Oldfiles", ActiveWorkbook) Then Worksheets.Add With ActiveSheet .Name = "OldFiles" .Visible = xlVeryHidden End With End If End Sub 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 --- Regards, Norman "Ken Loomis" wrote in message ... I need to test for the existence of a specific worksheet in the active workbook. The sheet name will always be "OldFiles" and I need to create it if is doesn't exist. Also, is there a way to make the new sheet ("OldFiles") invisible? Ken |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
most of menus are dimmed and the worksheet is invisible | Excel Discussion (Misc queries) | |||
invisible words or comment in the worksheet. | Excel Discussion (Misc queries) | |||
Controls in all worksheets are suddenly invisible | Excel Discussion (Misc queries) | |||
How to check if a worksheet exists in worksheet collection | Excel Programming | |||
Printing multiple worksheets only if data exists | Excel Programming |