How to use combobox to select different sheet?

anthonymedz

Board Regular
Joined
Jan 30, 2015
Messages
55
Hi guys,

Can you help me on this. I know this is simple to you. I have a project that i need to simply use a combobox in a userform to select a sheet per categories.
For example, if i have a category of Fruits and use the combo box it will have a drop down of mango and will select on that particular sheet.

Fruits(Combobox1)
Mango(sheet1)
Banana(sheet2)
Guava(sheet3)

Cars(Combobox2)
Toyota(Sheet4)
Honda(sheet5)
Mitsubishi(sheet6)

Thanks for the advance help.
 

Some videos you may like

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
16,874
Office Version
  1. 2013
Platform
  1. Windows
So you have a ComboBox Named ComboBox1.

And When you select on Mango you want to be taken to a sheet named Mango.
Is that what you want.

It not please explain again.
 

jolivanes

Well-known Member
Joined
Sep 5, 2004
Messages
1,630
Office Version
  1. 2013
  2. 2007
Platform
  1. Windows
Maybe
Code:
Private Sub ComboBox1_Change()
Sheets(ComboBox1.Value).Select
Unload Me
End Sub
 

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
16,874
Office Version
  1. 2013
Platform
  1. Windows
Now if you Open your Userform like this:
Userform1.show Modeless

You can work on your sheet while you have Your Userform visible.

And use a script like this:
Code:
Private Sub ComboBox1_Change()
'Modified  2/21/2019  12:53:50 AM  EST
Application.Goto Sheets(ComboBox1.Value).Range("B3"), Scroll:=True
End Sub
 

anthonymedz

Board Regular
Joined
Jan 30, 2015
Messages
55

ADVERTISEMENT

Hi Sir,

yes you are correct.
If im going to select the Combobox1 there is a drop down list of Mango, Banana, Guava and will taken me to that sheet if im going to choose that kind of fruits.
 

anthonymedz

Board Regular
Joined
Jan 30, 2015
Messages
55
So you have a ComboBox Named ComboBox1.

And When you select on Mango you want to be taken to a sheet named Mango.
Is that what you want.

It not please explain again.


Hi Sir,

yes you are correct.
If im going to select the Combobox1 there is a drop down list of Mango, Banana, Guava and will taken me to that sheet if im going to choose that kind of fruits.
 

anthonymedz

Board Regular
Joined
Jan 30, 2015
Messages
55

ADVERTISEMENT

Now if you Open your Userform like this:
Userform1.show Modeless

You can work on your sheet while you have Your Userform visible.

And use a script like this:
Code:
Private Sub ComboBox1_Change()
'Modified  2/21/2019  12:53:50 AM  EST
Application.Goto Sheets(ComboBox1.Value).Range("B3"), Scroll:=True
End Sub

Sorry.. i tried your code but its not working. I cant see anything when i click the combobox1.
 

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
16,874
Office Version
  1. 2013
Platform
  1. Windows
So you can see a sheet name in the Combobox Correct?
And if you click on the sheet name you should be taken to that sheet. If you have installed my script in the combobox.
 

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
16,874
Office Version
  1. 2013
Platform
  1. Windows
So are you saying you do not see anything in the Combobox?

So if you want to use a Combobox to go to certain sheets you first must load the combobox with the sheet names.

Have you done that?

Do you want to load all sheet names into the combobox and then select which one you want to go to when you select it from the combobox
 

anthonymedz

Board Regular
Joined
Jan 30, 2015
Messages
55
So are you saying you do not see anything in the Combobox?

So if you want to use a Combobox to go to certain sheets you first must load the combobox with the sheet names.

Have you done that?

Do you want to load all sheet names into the combobox and then select which one you want to go to when you select it from the combobox



Yes, you are correct. I want to load all sheet names into the combobox1 and then go to that sheet when i select it from the combobox.
 

Watch MrExcel Video

Forum statistics

Threads
1,109,446
Messages
5,528,802
Members
409,836
Latest member
karnasrinivas
Top