gheyman
Well-known Member
- Joined
- Nov 14, 2005
- Messages
- 2,347
- Office Version
- 365
- Platform
- Windows
I have code that pulls the multiselections from my ListBox and places them in column AA. Right now its pulling the data from the first row in my listbox. (the listbox shows all the data from RowSource:='Pricing Summary'!A9:L200) When the user selects items from the listbox I need the data in the second column fo the kist box to be stored in column AA.
Is there a way to do this? Or do I need to change the order the list box is showing the data and put the data I need to go in column AA be the whats showing in the first column of the TextBox.
Dim Msg As String
Dim i As Integer
Dim NextRow As Long
Worksheets("Tables").Select
' Clear Cells First
Range("AA1:AA200").Select
Selection.ClearContents
Range("AA1").Select
' Determine the next empty row
NextRow = Application.WorksheetFunction. _
CountA(Range("AA:AA")) + 1
' Transfer the name
For i = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(i) Then
Cells(i + 1, 27) = ListBox1.List(i)
End If
Next i
Is there a way to do this? Or do I need to change the order the list box is showing the data and put the data I need to go in column AA be the whats showing in the first column of the TextBox.
Dim Msg As String
Dim i As Integer
Dim NextRow As Long
Worksheets("Tables").Select
' Clear Cells First
Range("AA1:AA200").Select
Selection.ClearContents
Range("AA1").Select
' Determine the next empty row
NextRow = Application.WorksheetFunction. _
CountA(Range("AA:AA")) + 1
' Transfer the name
For i = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(i) Then
Cells(i + 1, 27) = ListBox1.List(i)
End If
Next i