Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Something like this worked ok for me:
Option Explicit Private Sub CommandButton1_Click() Dim iCtr As Long Dim oRow As Long Dim wks As Worksheet Set wks = Worksheets("sheet2") oRow = 1 With Me.ListBox1 For iCtr = 0 To .ListCount - 1 If .Selected(iCtr) Then wks.Cells(oRow, "A").Value = .List(iCtr) oRow = oRow + 1 End If Next iCtr End With Unload Me End Sub Private Sub UserForm_Initialize() Dim iCtr As Long With Me.ListBox1 .MultiSelect = fmMultiSelectMulti For iCtr = 1 To 10 .AddItem "asdf" & iCtr Next iCtr End With End Sub You'll want to loop through all the items in that listbox (0 to .listcount -1) to see if it's selected. evangray123 wrote: Thanks for the tip...... Maybe you can tell me why I am having trouble getting the data from my multiple selection listbox in my form, to the spreadsheet. It doesnt seem to be transferring any of the info, and I am having some trouble figuring it out. If the user selects multiple items, it should transfer to the spreadsheet with each selection listed and seperated by a comma. Thanks -- evangray123 ------------------------------------------------------------------------ evangray123's Profile: http://www.excelforum.com/member.php...o&userid=17429 View this thread: http://www.excelforum.com/showthread...hreadid=378164 -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to automatically fill and submit (in batch) an online form fromdata in a excel sheet??? | Excel Discussion (Misc queries) | |||
saveto or Submit Form functionality in Excel | Excel Worksheet Functions | |||
Form with submit button | Excel Worksheet Functions | |||
I wanta infopath form to submit data to an excel databse file | Excel Discussion (Misc queries) | |||
Submit User Form Contents to next available row | Excel Programming |