Thread: calling a macro
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default calling a macro

when the macro fires using the commandbar button, the sheet will still be
the activesheet

Sub Btn_Click()
if activesheet.name < sheet1.Name then
activesheet.visible = xlSheetHidden
End if
Sheet1.Activate
End sub

--
Regards,
Tom Ogilvy

"jhahes" wrote in
message ...

Thanks Tom, I like that idea, didn't think of it. However the reason I
want each page to go back to the home page is that I would also put
this code in each command bar code.

Call Macro ("Sheet1".activate)
Sheet55.visible = xlhidden ' or whatever sheet i am on

Basically from the main page, a user can go to about 50 or so sheets
and look at the detail of some products, however when done looking I
would like for them to go back to the main page, but it leaves up the
page they just looked at the bottom, and pretty soon I have 25 or so
sheets open. I understand that I can hide all of them on Workbook_Open
or close.

Is there a better solution to this

Thanks for any help


--
jhahes
------------------------------------------------------------------------
jhahes's Profile:

http://www.excelforum.com/member.php...o&userid=23596
View this thread: http://www.excelforum.com/showthread...hreadid=392594