LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default ListBox with hidden and visible sheet names?

Hi,

Me again. I have created a userform with a listbox. I can view the
sheets with the following code:

Private Sub UserForm_Initialize()
Dim sh As Variant
For Each sh In ActiveWorkbook.Sheets
If sh.Visible = True Then
Me.ListBox1.AddItem sh.Name
End If
Next sh
With ListBox1
..Value = ActiveSheet.Name
End With
End Sub

As you can tell I can only veiw the visible sheets. What would I need
to change to view all sheets? This is my goal, create 2 cmdbuttons,
View & Print. Each one does exactly what it says view: views the sheet
and if the sheet is hidden it will unhide the sheet, print: prints the
selected sheet only if it is visible. Also, would there be a way to
exclude some of my worksheets from showing up in the listbox. I have 28
sheets and would only like the user to be able to select 23 of the
sheets. 5 worksheets are for coding only. If anyone has some ideas or
suggestions, could you please show me the light... :) Right now VBA and
I are in a fight and VBA is winning.

Rockee
Excel 2003


---
Message posted from http://www.ExcelForum.com/

 
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
Copy Visible Cells in Sheet with Merged and Hidden Cells rtwiss Excel Discussion (Misc queries) 5 April 25th 23 09:08 AM
Workbook Open but not visible (and not HIDDEN?!?) mcleester Excel Discussion (Misc queries) 0 December 30th 08 03:02 PM
Populating listbox with sheet names johnb Excel Discussion (Misc queries) 1 May 16th 08 12:33 PM
Problem pasting a row from a hidden sheet to the first free row on another visible sheet Didier Poskin Excel Programming 2 January 10th 04 01:18 AM
Check status row (hidden or visible)? Martin Los Excel Programming 1 December 18th 03 03:32 PM


All times are GMT +1. The time now is 11:30 PM.

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

About Us

"It's about Microsoft Excel"