ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Add sheets that are unhide (https://www.excelbanter.com/excel-programming/277350-re-add-sheets-unhide.html)

Bob Phillips[_5_]

Add sheets that are unhide
 
Gus,

Here's some code

Private Sub ComboBox1_DropButtonClick()
Dim i As Long
ComboBox1.Clear
With ActiveWorkbook
For i = 1 To .Worksheets.Count
If .Worksheets(i).Visible = True Then
ComboBox1.AddItem .Worksheets(i).Name
End If
Next i
End With
ComboBox1.ListIndex = 0
End Sub

--

HTH

Bob Phillips

"GUS" wrote in message
...
How can we add to a combobox (from controltoolbox toolbar)
all the sheets that are unhide in a workbook.

The code must be placed after combobox1.clear


Private Sub ComboBox1_DropButtonClick()
ComboBox1.Clear

''''code here



ComboBox1.Text = "Go To..."
End Sub






All times are GMT +1. The time now is 10:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com