Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Choosing items in a list box
I am writing a macro to print timesheets.
In case that the secretary doesn't want to print one out for every person in the branch I want a userform to select one or individuals. How do I create a userform with names and corresponding checkboxes so the user may select individuals to generate the desired time sheets. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Choosing items in a list box
If you can manage with a standard listbox where you select with click, ctrl
click or shift click then try this: Private Sub UserForm_Initialize() Dim L As Long With Me.ListBox1 ..MultiSelect = fmMultiSelectExtended For L = 1 To 20 ..AddItem Sheets(1).Cells(L, 1).Value Next End With End Sub Private Sub CommandButton1_Click() Dim L As Long For L = 0 To ListBox1.ListCount - 1 If ListBox1.Selected(L) = True Then _ MsgBox ListBox1.List(L) Next End Sub HTH. Best wishes Harald "David Gerstman" skrev i melding ... I am writing a macro to print timesheets. In case that the secretary doesn't want to print one out for every person in the branch I want a userform to select one or individuals. How do I create a userform with names and corresponding checkboxes so the user may select individuals to generate the desired time sheets. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Choosing Names From a List | Excel Worksheet Functions | |||
Choosing multiple items in a drop down list | Excel Discussion (Misc queries) | |||
Choosing data based on Match to several items | Excel Worksheet Functions | |||
choosing files using an excel list... | Excel Programming | |||
choosing from a list in VB | Excel Programming |