ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   create a sheet but hiding it (https://www.excelbanter.com/excel-programming/316075-re-create-sheet-but-hiding.html)

crispbd[_18_]

create a sheet but hiding it
 

Sub CheckAdminPage()
Dim CurSheet As String, NS As Object
Dim AdminPage As String
On Error GoTo SkipAll


AdminPage = "AdminPage"


CurSheet = ActiveSheet.Name
Application.ScreenUpdating = False

For Each c In ThisWorkbook.Sheets
If c.Name = AdminPage Then Exit Sub
Next

Set NS = ThisWorkbook.Sheets.Add
NS.Activate

NS.Name = AdminPage
NS.Move after:=Sheets(ThisWorkbook.Sheets.Count)
NS.Visible = False
Sheets(CurSheet).Activate


SkipAll:
Application.ScreenUpdating = True

End Su

--
crispb
-----------------------------------------------------------------------
crispbd's Profile: http://www.excelforum.com/member.php...fo&userid=1088
View this thread: http://www.excelforum.com/showthread.php?threadid=27636



All times are GMT +1. The time now is 10:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com