Unhiding Sheets with Combobox selection and Duplicating Sheets Automatically

D_Davis

New Member
Joined
Sep 27, 2011
Messages
10
Hello,

I'm new here and seeking some assistance in a project I'm working on that's due in a couple days. I have searched at least 100 threads on multiple boards on the web for an answer and i'm partially there but not quite so with that being said here's what i'd appreciate some assistance with.

I have 25 sheets in the workbook and a combobox on the main page, The combobox references a range of 1-25 that represents the 25 hidden pages. right now i can get the sheets to unhide one at a time based on the selection e.g. combobox option 1 will unhide sheet 1 but the sheet are representing sites in a design so i need to have the option to select multiple sites in the combobox option so for example if i select 5 then sheets 1-5 should unhide. I hope I've explained that clearly.

The other question or option would be to just duplicate sheet 1 based on the combobox selection e.g. selection 5 duplicates sheet 1 5 times.

Thanks in advance for any assistance guys.

Dail
 
I had made a mistake. It should be .Visible and not .Hidden

Code:
Private Sub ComboBox2_Change()
    Dim i      As Integer
    If ComboBox1.Value <> "" Then
        Application.ScreenUpdating = False
        For i = 1 To ComboBox2.Value
            Sheets("Site" & i)[COLOR="Red"].Visible[/COLOR] = False
        Next i
        Application.ScreenUpdating = True
    [COLOR="Red"]End If[/COLOR]
End Sub


Than did it!!! I changed to Visible=True and its working great now! Thanks a mil, at least i'll be able to sleep tonight :-)
 
Upvote 0

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

Forum statistics

Threads
1,225,156
Messages
6,183,246
Members
453,152
Latest member
ChrisMd

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
Back
Top