Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Selecting a worksheet with a ComboBox

I have a ComboBox that is populated by all of the
worksheets contained in a workbook. I would like to select
a worksheet by using the ComboBox. I haven't been able to
get anything to work. I would imagine you would assign the
combobox value to a variable and select the worksheet
using the variable name or is there a better way?

Thanks,

Todd
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Selecting a worksheet with a ComboBox

Why not just use

Worksheets(Combobox1.Value).Activate

in the code linked to the combobox click event?

--
HTH

-------

Bob Phillips
"Todd" wrote in message
...
I have a ComboBox that is populated by all of the
worksheets contained in a workbook. I would like to select
a worksheet by using the ComboBox. I haven't been able to
get anything to work. I would imagine you would assign the
combobox value to a variable and select the worksheet
using the variable name or is there a better way?

Thanks,

Todd



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Selecting a worksheet with a ComboBox

You should make a list of all of the worksheet names and then define th
list as a named list (Insert Name Define).

Now in the Rowsource property of the combobox insert

sheet!name

where sheet is the worksheet containing your named list and name is th
defined name of the list.

When you run the combobox now then you will have the worksheets t
select from.

Finally place the following code
Code
-------------------


Private Sub ComboBox1_Change()
Worksheets(ComboBox1.Text).Activate
End Sub
-------------------


changing combobox1 to match the name of your combobox.

HTH

Gordo

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Selecting a worksheet with a ComboBox

That's what it was...I had it linked to a Change event.

Thanks a lot Bob
-----Original Message-----
Why not just use

Worksheets(Combobox1.Value).Activate

in the code linked to the combobox click event?

--
HTH

-------

Bob Phillips
"Todd" wrote in

message
...
I have a ComboBox that is populated by all of the
worksheets contained in a workbook. I would like to

select
a worksheet by using the ComboBox. I haven't been able

to
get anything to work. I would imagine you would assign

the
combobox value to a variable and select the worksheet
using the variable name or is there a better way?

Thanks,

Todd



.

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
Need to update a ComboBox when selecting a sheet [email protected] Excel Worksheet Functions 1 October 31st 07 02:23 PM
Selecting any cell in a column I want my ComboBox to show. How? ABP MLundqvist Excel Discussion (Misc queries) 4 March 1st 06 01:15 PM
Copying Worksheet triggers Click event of combobox on another worksheet Robert[_20_] Excel Programming 0 January 23rd 04 07:40 PM
Combobox: Selecting values from a row and place in combi box plus update New user Excel Programming 2 January 22nd 04 01:46 PM
Selecting/Activating Control Tools Combobox on Sheet steve Excel Programming 5 October 10th 03 10:38 PM


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