LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default ex - list box display sheets

What is your question?

The worksheets collection already has all the worksheets
by name. Why are you trying to build your own?

Patrick Molloy
Microsoft Excel MVP

-----Original Message-----
Ok I have got it down to display the sheets that I

require, but it still
displays the others as a check box but with no name

Private Sub UserForm_Initialize()
Dim SheetData() As String
Set OriginalSheet = ActiveSheet

ShtCnt = ActiveWorkbook.Sheets.Count

ReDim SheetData(1 To ShtCnt, 1 To 4)

shtnum = 1

For shtnum = 1 to ShtCnt
' On first pass shtnum = 1 therefore the if statement is
false and Goto shtnum is executed.
If shtnum 2 And shtnum < 31 Or shtnum 39 And shtnum <
61 Then

' If currently the activesheet then List Position
shtnum - 1
If Sheets(shtnum).Name = ActiveSheet.Name Then
ListPos = shtnum - 1
End If

SheetData(shtnum, 1) = Sheets(shtnum).Name

Select Case TypeName(Sheets(shtnum))
Case "Worksheet"
SheetData(shtnum, 2) = "Sheet"
SheetData(shtnum, 3) =
Application.CountA(Sheets(shtnum).Cells)
End Select

If Sheets(shtnum).Visible Then
SheetData(shtnum, 4) = "True"
Else
SheetData(shtnum, 4) = "False"
End If
End If
Next Sht

With ListBox1
.ColumnWidths = "100 pt"
.List = SheetData
.ListIndex = ListPos
End With
End Sub


anyone any ideas


---
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
Display part of list dependant on Validation list selection Jules73 Excel Worksheet Functions 0 August 12th 09 02:21 PM
DISPLAY TWO DIFFERENT SHEETS ON SCREEN [email protected] Excel Discussion (Misc queries) 1 March 22nd 09 08:20 PM
Excell Dropdown List. Display alternate text than found in list. Shawnn Excel Discussion (Misc queries) 14 December 11th 08 07:43 PM
List Sheets excluding sheets named ***-A Dolphinv4 Excel Discussion (Misc queries) 1 December 15th 07 09:29 AM
In 3 active sheets in wkbk, determine& display the # of sheets that have data wrpalmer Excel Discussion (Misc queries) 1 November 4th 05 02:01 PM


All times are GMT +1. The time now is 08:54 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"