Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Populating combox with worksheet names

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Populating combox with worksheet names

Thank you Jacob, worked great. I have slightly amended to code to only load
visible worksheets into the combobox.

Cheers
Martin

"Jacob Skaria" wrote:

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Populating List box with tab/worksheet names Nick O[_2_] Excel Programming 5 November 6th 08 03:08 PM
Populating listbox with sheet names johnb Excel Discussion (Misc queries) 1 May 16th 08 12:33 PM
Populating ComboBox with Folder Names Tyrell Excel Programming 1 March 8th 06 04:25 PM
Populating work sheet combox with another work sheet values sjayar Excel Discussion (Misc queries) 1 October 29th 05 03:22 PM
Populating Userform ComboBox with worksheet names in XL2003 MAWII Excel Programming 0 August 9th 05 09:07 PM


All times are GMT +1. The time now is 03:16 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"