MrExcel Publishing
Your One Stop for Excel Tips & Solutions

open workbook always on the same sheet..please help me...


Posted by newby on May 08, 2000 11:57 PM

i have 3 worksheet in workbook callled abc.xls

my worksheet are sheet1,sheet2 and sheet3

what i want to do is whenever i open my abc workbook,
it always open in sheet1..please help me..

now when i opened my abc workbook it always
open at the last sheet that i use before i close my
worbook..thanks


Posted by Ivan Moala on May 09, 2000 12:29 AM


Newby
Put this into the Thisworkbook Excel object
VBA via Alt F11 / Ctrl R

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

Provided Sheet1 (your sheet Name on the Tab)
is sheet1 it will activate Sheet1 upon openning,
even if you or someone else changes the name to
something else.


Ivan

Posted by newby on May 09, 2000 1:13 AM

thanks Ivan..i will try it now.regards

Posted by newby on May 09, 2000 2:27 AM

It works great until...........

i rename sheet1 to menu..then i change the code

to sheets(1) to menu too..but it don't work

any ideas???..thanks

i have 3 worksheet in workbook callled abc.xls

Posted by Ivan Moala on May 09, 2000 4:03 AM

Re: It works great until...........

to sheets(1) to menu too..but it don't work any ideas???..thanks

Leave the code the same and it should still work
as long as the sheet code refers to Sheet1
ie. if you look @ the sheet name in the project
explorer you will should see Sheet1(Menu).
If you do then the code should work as given.


ivan

: : i have 3 worksheet in workbook callled abc.xls

Posted by newby on May 09, 2000 4:36 AM

i've got it..you are great...thanks..

: