Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
vba:Userform
I'd like to know how to make a userform that tells the
user to "Select Worksheets". Worksheet will be displayed in the listbox as selected. Selected Worksheets will be stored in an array for future processing, when command button (Done) is click. Thanks in advance. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
vba:Userform
Alex,
Here is some code Dim arysheets Private Sub CommandButton1_Click() Dim i As Long Dim j As Long With Me.ListBox1 For i = 0 To .ListCount - 1 If .Selected(i) Then j = j + 1 If j = 1 Then ReDim arysheets(1 To 1) Else ReDim Preserve arysheets(1 To j) End If arysheets(j) = .List(i) End If Next i End With End Sub Private Sub UserForm_ACtivate() Dim sh As Worksheet For Each sh In ActiveWorkbook.Worksheets Me.ListBox1.AddItem sh.Name Next sh End Sub -- HTH RP (remove nothere from the email address if mailing direct) "Alex" wrote in message ... I'd like to know how to make a userform that tells the user to "Select Worksheets". Worksheet will be displayed in the listbox as selected. Selected Worksheets will be stored in an array for future processing, when command button (Done) is click. Thanks in advance. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
UserForm | Excel Worksheet Functions | |||
userform always on top? | Excel Programming | |||
Linking userform to userform in Excel 2003 | Excel Programming | |||
Userform inside another userform | Excel Programming | |||
userform | Excel Programming |