Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default 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
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
Choosing Names From a List ppidgursky Excel Worksheet Functions 1 April 11th 09 12:08 AM
Choosing multiple items in a drop down list Shad Excel Discussion (Misc queries) 9 July 7th 08 06:38 PM
Choosing data based on Match to several items Nipper Excel Worksheet Functions 5 May 12th 06 07:19 PM
choosing files using an excel list... davidbev008 Excel Programming 1 December 3rd 04 08:23 PM
choosing from a list in VB Mary Agnes Excel Programming 0 February 5th 04 03:51 PM


All times are GMT +1. The time now is 06:31 AM.

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"