ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   workbook open event (https://www.excelbanter.com/excel-programming/393373-workbook-open-event.html)

User[_2_]

workbook open event
 
dears,

I want the workbook when it is opened to activate a specific sheet and
hide the remaining sheets. please help me in this regard.

thanks,
naweed


Vasant Nanavati

workbook open event
 
Put the following code in the ThisWorkbook module:

Private Sub Workbook_Open()
Dim ws As Worksheet
For Each ws In Worksheets
If ws.name < "xxx" then ws.Visible = xlSheetHidden
Next
End Sub
__________________________________________________ _______________________

"User" wrote in message
ups.com...
dears,

I want the workbook when it is opened to activate a specific sheet and
hide the remaining sheets. please help me in this regard.

thanks,
naweed




Mike

workbook open event
 
Try this

Private Sub Workbook_Open()
Sheet1.Activate
Sheet2.Visible = xlSheetHidden
Sheet3.Visible = xlSheetHidden
End Sub


"User" wrote:

dears,

I want the workbook when it is opened to activate a specific sheet and
hide the remaining sheets. please help me in this regard.

thanks,
naweed



Mike H

workbook open event
 
Try:-

Private Sub Workbook_Open()
For i = 1 To ActiveWorkbook.Worksheets.Count
Worksheets(i).Select
If Worksheets(i).Name < "Sheet1" Then ' Change to be the one you want active
Worksheets(i).Visible = False
End If
Next i
End Sub


Mike

"User" wrote:

dears,

I want the workbook when it is opened to activate a specific sheet and
hide the remaining sheets. please help me in this regard.

thanks,
naweed



Vasant Nanavati

workbook open event
 
No need to select any of the worksheets.
__________________________________________________ _______________________

"Mike H" wrote in message
...
Try:-

Private Sub Workbook_Open()
For i = 1 To ActiveWorkbook.Worksheets.Count
Worksheets(i).Select
If Worksheets(i).Name < "Sheet1" Then ' Change to be the one you want
active
Worksheets(i).Visible = False
End If
Next i
End Sub


Mike

"User" wrote:

dears,

I want the workbook when it is opened to activate a specific sheet and
hide the remaining sheets. please help me in this regard.

thanks,
naweed






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

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