Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default 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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default 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


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default 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






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
WorkBook open event microsoft[_7_] Excel Programming 0 March 12th 07 11:35 AM
workbook open event JT[_2_] Excel Programming 2 December 22nd 04 03:59 PM
Workbook Open Event Stuart[_5_] Excel Programming 1 July 6th 04 08:47 PM
Workbook Open event Todd Huttenstine Excel Programming 1 April 21st 04 07:06 PM
Workbook Open Event Paul D[_2_] Excel Programming 0 October 17th 03 02:39 AM


All times are GMT +1. The time now is 05:58 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"