LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default ListBox Items with Multiple Columns into Excel

Well, I am stumped. Does anyone know how to take items from a listBox
that contain multiple columns (4 to be exact) and transfer them into
multiple columns in an excel worksheet? Any help would be greatly
appreciated!

Here is the code I have developed, but it only gets the first column
entered:

Private Sub OKButton_Click()
Dim lPart As Long
Dim lItem As Long
Dim CellX As Long
Dim CellW As Long
Dim CellY As Long
Dim CellZ As Long
Dim I As Long
Dim RangeRow As String
Dim ws As Worksheet
Set ws = Worksheets("Order Form")

lPart = Me.ListBox1.ListIndex
CellX = 12
RangeRow = "C"


With Me.ListBox1
For lItem = 0 To ListBox1.ListCount - 10
' If ListBox1.Selected(lPart) = True Then
If ListBox1.Selected(lItem) = True Then
CellX = CellX + 1


Range(RangeRow & CellX).Value = ListBox1.List(lItem, 1)

End If
Next lItem
End With
Unload SEARCH
End Sub



*** Sent via Developersdex http://www.developersdex.com ***
 
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
Adding items to columns in a listbox Daniel Bonallack Excel Discussion (Misc queries) 1 May 7th 07 04:45 PM
Select multiple items in a listbox uecem[_4_] Excel Programming 2 November 26th 04 02:00 AM
select mulitiple columns and items from a listbox TK Excel Programming 1 August 26th 04 05:15 AM
Selecting multiple items and columns from ListBox TK Excel Programming 0 August 25th 04 01:19 AM
Transfer multiple columns items form listbox to range Rolo[_3_] Excel Programming 3 November 15th 03 06:50 PM


All times are GMT +1. The time now is 12:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"