Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Change Sheet By Macro

Private Sub cboChangeSheet_Click()
Dim sh as Worksheet
On Error Resume Next
set sh = thisWorkbook.worksheets(cboChangeSheet.Value)
On Error goto 0
if not sh is nothing then
Sh.Activate
sh.Range("A1").Select
End if
End sub

You can also populate the comoboxbox with the activate event in the same
module.

Private Sub Worksheet_Activate()
Dim sh as Worksheet
cboChangeSheet.clear
for each sh in thisworkbook.Worksheets
if Ucase(sh.name) < "INPUT" then
cboChangeSheet.additem sh.name
end if
Next
End sub

Might need to run similar code in Workbook_Open to get the initial list.

Regards,
Tom Ogilvy


"Emma Hope" wrote in message
...
I have a workbook with lots & lots of sheets, i want to
put a combo box on the first sheet and when the user
selects the name of the sheet from the combox box, it
automatically takes them to that sheet.

Additionally if possible, i would like the list of sheet
names to be generated automatically and this to be updated
in the combo box list range also automatically.

My first sheet is called Input, all the others are 10
digit numbers. My combo box is called cboChangeSheet and
links to cell D2 & the list of sheet names is currently
(hand typed) in cells H1:H70.

Hope you can help.
Emma



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
Macro change sheet tab color and name Gene Augustin Excel Discussion (Misc queries) 7 March 8th 09 09:03 PM
change in colunms of sheet- and macro ? Tim R Excel Discussion (Misc queries) 1 April 24th 08 11:50 PM
Why doesnt it change sheet in the macro [email protected] Excel Worksheet Functions 1 April 24th 07 06:06 PM
Macro to change data in a sheet Diana Excel Discussion (Misc queries) 1 April 28th 06 08:01 PM
change sheet name macro WBTKbeezy Excel Worksheet Functions 4 February 22nd 06 03:51 PM


All times are GMT +1. The time now is 03:34 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"