Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VISUAL BASIC CODE

Please advise what visual basic code I need to use to always open my file
showing the first worksheet even though I save the file at 2nd or 3rd
worksheets.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default VISUAL BASIC CODE

Josephine,
Assuming you are using something like:
Set MyWB=Workbooks.Open(PathAndFilename)
add a line:
MyWB.Worksheets(1).Activate
......

NickHK

"Josephine Ng" <Josephine wrote in message
...
Please advise what visual basic code I need to use to always open my file
showing the first worksheet even though I save the file at 2nd or 3rd
worksheets.



  #3   Report Post  
Posted to microsoft.public.excel.programming
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default VISUAL BASIC CODE

You could also try an event handler. It goes in the ThisWorkBook module.

Private Sub Workbook_Open()
Worksheets(1).Activate
End Sub

"Josephine Ng" wrote:

Please advise what visual basic code I need to use to always open my file
showing the first worksheet even though I save the file at 2nd or 3rd
worksheets.

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
Visual Basic code Pickle Excel Discussion (Misc queries) 1 September 4th 08 03:35 PM
I need a visual basic code....please Rhonda Excel Discussion (Misc queries) 1 March 5th 07 01:18 PM
Visual basic Code GRobertson Excel Programming 3 January 10th 05 02:16 PM
visual basic code Whitey Excel Programming 1 October 26th 04 04:05 PM
Visual Basic Code Robert Couchman Excel Programming 2 February 2nd 04 03:10 PM


All times are GMT +1. The time now is 09:02 PM.

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

About Us

"It's about Microsoft Excel"