access to hidden sheets

KDS14589

Board Regular
Joined
Jan 10, 2019
Messages
165
Office Version
  1. 2016
Platform
  1. Windows
I have A combo box named comboWs that has a list of all 63 worksheets in the workbook, but all are hidden except the active one. Combo's output is on worksheet named general.switchboard in cell "O54" (this worksheet is visible=true). I want to go to the worksheet selected in the combo. I've tried several codes and even a few from the internet. Most from the net work with listbox's, user forms, or didn't connect to hidden sheets. I've tried to unhide the sheet by code first before selecting but that didn't work either. I'm at a point were the solution may be simple but I've tried so many times and with many codes I've started eating the Halloween candy that's for the kids. ::oops::
Help!!!!!
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
74,799
Office Version
  1. 365
Platform
  1. Windows
Is you combo an ActiveX, or Forms Control combo?
 

James006

Well-known Member
Joined
Apr 4, 2009
Messages
3,680
Hello,

Have you tested

Code:
Private Sub ComboBox1_Change()
    Sheets(ComboBox1.Text).Visible = True
    Application.Goto Sheets(ComboBox1.Text).Range("A1")
End Sub

Hope this will help
 

KDS14589

Board Regular
Joined
Jan 10, 2019
Messages
165
Office Version
  1. 2016
Platform
  1. Windows
STILL NO LUCK
my last try is

Private Sub gotoCombows_Click()
Sheets("general.switchboard").Range("O53").Visible = True
Application.Goto Sheets("general.switchboard").Range("A1")
End Sub

I tried your code but that didn't work either.
I've added a command button next to the combo box so I don't get a loop that freezes up my computer
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
74,799
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

Assuming it's an activex combo (as you never answered my question).
Try
Code:
Private Sub [COLOR=#ff0000]comboWs[/COLOR]_Click()
    With Me.[COLOR=#ff0000]comboWs[/COLOR]
        Sheets(.Value).Visible = xlSheetVisible
        Sheets(.Value).Activate
    End With
End Sub
 

KDS14589

Board Regular
Joined
Jan 10, 2019
Messages
165
Office Version
  1. 2016
Platform
  1. Windows
sorry I didn't answer.
I was distracted.
yes it is an activex.
and your code works.
thank you!!!!!
I'm sorry for the delay.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
74,799
Office Version
  1. 365
Platform
  1. Windows
Glad we could help & thanks for the feedback
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,168,158
Messages
5,857,707
Members
431,891
Latest member
shirazx3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top