Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How do I change a worksheet in Excel by using a combo-box?

I want to change the worksheet in Excel by choosing it in a combo-box that
displays 18 diferent options, and each one of these options displayed in the
combo-box, corresponds to a diferent worksheet, is it possible?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How do I change a worksheet in Excel by using a combo-box?

Possibly

Private Sub Combobox1_Click()
if Combobox1.ListIndex < -1 then
Worksheets(Combobox1.Value).Select
end if
End Sub
This assumes the text in the combobox is the name of the sheet.
--
Regards,
Tom Ogilvy

"Pedro Serra" <Pedro wrote in message
...
I want to change the worksheet in Excel by choosing it in a combo-box that
displays 18 diferent options, and each one of these options displayed in

the
combo-box, corresponds to a diferent worksheet, is it possible?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default How do I change a worksheet in Excel by using a combo-box?

Tom I'm starting with programing and I think I understood the code u wrote to
me but how can I Know the name of the combo-box I've created, because in your
example u call it Combobox1, right, but in Excel the combo-box as a different
name, right?

"Tom Ogilvy" wrote:

Possibly

Private Sub Combobox1_Click()
if Combobox1.ListIndex < -1 then
Worksheets(Combobox1.Value).Select
end if
End Sub
This assumes the text in the combobox is the name of the sheet.
--
Regards,
Tom Ogilvy

"Pedro Serra" <Pedro wrote in message
...
I want to change the worksheet in Excel by choosing it in a combo-box that
displays 18 diferent options, and each one of these options displayed in

the
combo-box, corresponds to a diferent worksheet, is it possible?




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How do I change a worksheet in Excel by using a combo-box?

In design mode, right click on the combobox and select view code. This
should take you to the click event of the combobox and you can see what the
name is.

--
Regards,
Tom Ogilvy

"Pedro Serra" wrote in message
...
Tom I'm starting with programing and I think I understood the code u wrote

to
me but how can I Know the name of the combo-box I've created, because in

your
example u call it Combobox1, right, but in Excel the combo-box as a

different
name, right?

"Tom Ogilvy" wrote:

Possibly

Private Sub Combobox1_Click()
if Combobox1.ListIndex < -1 then
Worksheets(Combobox1.Value).Select
end if
End Sub
This assumes the text in the combobox is the name of the sheet.
--
Regards,
Tom Ogilvy

"Pedro Serra" <Pedro wrote in message
...
I want to change the worksheet in Excel by choosing it in a combo-box

that
displays 18 diferent options, and each one of these options displayed

in
the
combo-box, corresponds to a diferent worksheet, is it possible?






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default How do I change a worksheet in Excel by using a combo-box?

Sorry Tom but this code is not suitable for what I'm trying to do because, I
need to change the worksheet by selecting it in a combo box, not that the
combo assume the name of a worksheet!

For example, in the array I have Sheet 2, Sheet 3 and the combo box is in
Excel's sheet 1. When I choose in the combo box Sheet 2 I should go to this
worksheet

Do u think u can help on this?

Thanks in advanced!

"Tom Ogilvy" wrote:

In design mode, right click on the combobox and select view code. This
should take you to the click event of the combobox and you can see what the
name is.

--
Regards,
Tom Ogilvy

"Pedro Serra" wrote in message
...
Tom I'm starting with programing and I think I understood the code u wrote

to
me but how can I Know the name of the combo-box I've created, because in

your
example u call it Combobox1, right, but in Excel the combo-box as a

different
name, right?

"Tom Ogilvy" wrote:

Possibly

Private Sub Combobox1_Click()
if Combobox1.ListIndex < -1 then
Worksheets(Combobox1.Value).Select
end if
End Sub
This assumes the text in the combobox is the name of the sheet.
--
Regards,
Tom Ogilvy

"Pedro Serra" <Pedro wrote in message
...
I want to change the worksheet in Excel by choosing it in a combo-box

that
displays 18 diferent options, and each one of these options displayed

in
the
combo-box, corresponds to a diferent worksheet, is it possible?








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How do I change a worksheet in Excel by using a combo-box?

If the combobox in Sheet1 contains the entry Sheet2 in the dropdown list,
then if you assign the code I provided to the click event of the combobox in
Sheet1, it will do what you describe. I can't tell you what the name of the
combobox in sheet1 is nor did I ever recommend you name it the same as the
sheet name.
I told you how to discover the name of the combobox since you said you
didn't know it.

--
Regards,
Tom Ogilvy

"Pedro Serra" wrote in message
...
Sorry Tom but this code is not suitable for what I'm trying to do because,

I
need to change the worksheet by selecting it in a combo box, not that the
combo assume the name of a worksheet!

For example, in the array I have Sheet 2, Sheet 3 and the combo box is in
Excel's sheet 1. When I choose in the combo box Sheet 2 I should go to

this
worksheet

Do u think u can help on this?

Thanks in advanced!

"Tom Ogilvy" wrote:

In design mode, right click on the combobox and select view code. This
should take you to the click event of the combobox and you can see what

the
name is.

--
Regards,
Tom Ogilvy

"Pedro Serra" wrote in message
...
Tom I'm starting with programing and I think I understood the code u

wrote
to
me but how can I Know the name of the combo-box I've created, because

in
your
example u call it Combobox1, right, but in Excel the combo-box as a

different
name, right?

"Tom Ogilvy" wrote:

Possibly

Private Sub Combobox1_Click()
if Combobox1.ListIndex < -1 then
Worksheets(Combobox1.Value).Select
end if
End Sub
This assumes the text in the combobox is the name of the sheet.
--
Regards,
Tom Ogilvy

"Pedro Serra" <Pedro wrote in

message
...
I want to change the worksheet in Excel by choosing it in a

combo-box
that
displays 18 diferent options, and each one of these options

displayed
in
the
combo-box, corresponds to a diferent worksheet, is it possible?








  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default How do I change a worksheet in Excel by using a combo-box?

Tom
The problem is that when I assign the code to the click event the following
error occurs "Run time error: 424 - Object required" meaning that even after
I've changed the name of the combo box to Combobox1 and used the code u gave
something is still missing!

Is it possible if u can send me an Excel file with the code on it to my
email: , I think it it will be easier for me to
understand it and used.

Thanks again

"Tom Ogilvy" wrote:

If the combobox in Sheet1 contains the entry Sheet2 in the dropdown list,
then if you assign the code I provided to the click event of the combobox in
Sheet1, it will do what you describe. I can't tell you what the name of the
combobox in sheet1 is nor did I ever recommend you name it the same as the
sheet name.
I told you how to discover the name of the combobox since you said you
didn't know it.

--
Regards,
Tom Ogilvy

"Pedro Serra" wrote in message
...
Sorry Tom but this code is not suitable for what I'm trying to do because,

I
need to change the worksheet by selecting it in a combo box, not that the
combo assume the name of a worksheet!

For example, in the array I have Sheet 2, Sheet 3 and the combo box is in
Excel's sheet 1. When I choose in the combo box Sheet 2 I should go to

this
worksheet

Do u think u can help on this?

Thanks in advanced!

"Tom Ogilvy" wrote:

In design mode, right click on the combobox and select view code. This
should take you to the click event of the combobox and you can see what

the
name is.

--
Regards,
Tom Ogilvy

"Pedro Serra" wrote in message
...
Tom I'm starting with programing and I think I understood the code u

wrote
to
me but how can I Know the name of the combo-box I've created, because

in
your
example u call it Combobox1, right, but in Excel the combo-box as a
different
name, right?

"Tom Ogilvy" wrote:

Possibly

Private Sub Combobox1_Click()
if Combobox1.ListIndex < -1 then
Worksheets(Combobox1.Value).Select
end if
End Sub
This assumes the text in the combobox is the name of the sheet.
--
Regards,
Tom Ogilvy

"Pedro Serra" <Pedro
wrote in
message
...
I want to change the worksheet in Excel by choosing it in a

combo-box
that
displays 18 diferent options, and each one of these options

displayed
in
the
combo-box, corresponds to a diferent worksheet, is it possible?









  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How do I change a worksheet in Excel by using a combo-box?

OK, will do

--
Regards,
Tom Ogilvy

"Pedro Serra" wrote in message
...
Tom
The problem is that when I assign the code to the click event the

following
error occurs "Run time error: 424 - Object required" meaning that even

after
I've changed the name of the combo box to Combobox1 and used the code u

gave
something is still missing!

Is it possible if u can send me an Excel file with the code on it to my
email: , I think it it will be easier for me to
understand it and used.

Thanks again

"Tom Ogilvy" wrote:

If the combobox in Sheet1 contains the entry Sheet2 in the dropdown

list,
then if you assign the code I provided to the click event of the

combobox in
Sheet1, it will do what you describe. I can't tell you what the name of

the
combobox in sheet1 is nor did I ever recommend you name it the same as

the
sheet name.
I told you how to discover the name of the combobox since you said you
didn't know it.

--
Regards,
Tom Ogilvy

"Pedro Serra" wrote in message
...
Sorry Tom but this code is not suitable for what I'm trying to do

because,
I
need to change the worksheet by selecting it in a combo box, not that

the
combo assume the name of a worksheet!

For example, in the array I have Sheet 2, Sheet 3 and the combo box is

in
Excel's sheet 1. When I choose in the combo box Sheet 2 I should go to

this
worksheet

Do u think u can help on this?

Thanks in advanced!

"Tom Ogilvy" wrote:

In design mode, right click on the combobox and select view code.

This
should take you to the click event of the combobox and you can see

what
the
name is.

--
Regards,
Tom Ogilvy

"Pedro Serra" wrote in

message
...
Tom I'm starting with programing and I think I understood the code

u
wrote
to
me but how can I Know the name of the combo-box I've created,

because
in
your
example u call it Combobox1, right, but in Excel the combo-box as

a
different
name, right?

"Tom Ogilvy" wrote:

Possibly

Private Sub Combobox1_Click()
if Combobox1.ListIndex < -1 then
Worksheets(Combobox1.Value).Select
end if
End Sub
This assumes the text in the combobox is the name of the sheet.
--
Regards,
Tom Ogilvy

"Pedro Serra" <Pedro
wrote in
message
...
I want to change the worksheet in Excel by choosing it in a

combo-box
that
displays 18 diferent options, and each one of these options

displayed
in
the
combo-box, corresponds to a diferent worksheet, is it

possible?











  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default How do I change a worksheet in Excel by using a combo-box?

Thanks a lot Tom this was realy helpful for me!

"Tom Ogilvy" wrote:

OK, will do

--
Regards,
Tom Ogilvy

"Pedro Serra" wrote in message
...
Tom
The problem is that when I assign the code to the click event the

following
error occurs "Run time error: 424 - Object required" meaning that even

after
I've changed the name of the combo box to Combobox1 and used the code u

gave
something is still missing!

Is it possible if u can send me an Excel file with the code on it to my
email: , I think it it will be easier for me to
understand it and used.

Thanks again

"Tom Ogilvy" wrote:

If the combobox in Sheet1 contains the entry Sheet2 in the dropdown

list,
then if you assign the code I provided to the click event of the

combobox in
Sheet1, it will do what you describe. I can't tell you what the name of

the
combobox in sheet1 is nor did I ever recommend you name it the same as

the
sheet name.
I told you how to discover the name of the combobox since you said you
didn't know it.

--
Regards,
Tom Ogilvy

"Pedro Serra" wrote in message
...
Sorry Tom but this code is not suitable for what I'm trying to do

because,
I
need to change the worksheet by selecting it in a combo box, not that

the
combo assume the name of a worksheet!

For example, in the array I have Sheet 2, Sheet 3 and the combo box is

in
Excel's sheet 1. When I choose in the combo box Sheet 2 I should go to
this
worksheet

Do u think u can help on this?

Thanks in advanced!

"Tom Ogilvy" wrote:

In design mode, right click on the combobox and select view code.

This
should take you to the click event of the combobox and you can see

what
the
name is.

--
Regards,
Tom Ogilvy

"Pedro Serra" wrote in

message
...
Tom I'm starting with programing and I think I understood the code

u
wrote
to
me but how can I Know the name of the combo-box I've created,

because
in
your
example u call it Combobox1, right, but in Excel the combo-box as

a
different
name, right?

"Tom Ogilvy" wrote:

Possibly

Private Sub Combobox1_Click()
if Combobox1.ListIndex < -1 then
Worksheets(Combobox1.Value).Select
end if
End Sub
This assumes the text in the combobox is the name of the sheet.
--
Regards,
Tom Ogilvy

"Pedro Serra" <Pedro
wrote in
message
...
I want to change the worksheet in Excel by choosing it in a
combo-box
that
displays 18 diferent options, and each one of these options
displayed
in
the
combo-box, corresponds to a diferent worksheet, is it

possible?












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
Getting Combo boxes to change options based on other Combo boxes. Ancient Wolf New Users to Excel 1 March 27th 09 06:29 PM
Combo box range change saman110 via OfficeKB.com Excel Discussion (Misc queries) 5 September 14th 07 10:10 AM
combo box on change code frendabrenda1 Excel Discussion (Misc queries) 0 April 10th 06 04:21 PM
Using VB to change Combo box selection Richard Clayton Excel Programming 0 October 8th 04 03:21 PM
Before and after combo box change Dale[_7_] Excel Programming 1 October 7th 03 03:12 PM


All times are GMT +1. The time now is 12:41 AM.

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"