View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default Populating combox with worksheet names

Use the .Visible property which list out xlSheetHidden, xlSheetVeryHidden and
xlSheetVisible....

Private Sub CommandButton1_Click()
Dim ws As Worksheet

With frmMenu.cbStartUpWorksheet
For Each ws In Worksheets
If ws.Visible < xlSheetVeryHidden Then .AddItem ws.Name
Next
End With

End Sub

--
Jacob (MVP - Excel)


"Martin Parker" wrote:

Hi

I'm using the following to populate a combobox on a worksheet with the names
of all the worksheets in the workbook:-

Dim ws As Integer
With frmMenu.cbStartUpWorksheet
For ws = 1 To Sheets.Count
.AddItem Sheets(ws).Name
Next
End With

My question is I have one worksheet that is veryhidden and I dont want it to
show in the combobox. How do I do this?

Cheers