Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Losing data during transfer
Good morning, I am really hoping this is going to be my last question on lisboxes. Anyway, I am trying to transfer data from a listbox to a spreadsheet. Unfortunately the first entry in the listbox always gets dropped an the specified cell is blank. (Unless I force the cycle to go one les than the number of options in the listbox. If I do this, then th remaining item in the listbox shows up as the selection in the firs cell.) Anyway, here is my code. Any ideas on what I am doing wron here. Been trying to figure this out since yesterday afternoon and am guessing it is something simple... Private Sub CommandButton5_Click() Dim number As Integer Dim xcount As Integer number = 0 xcount = ListBox2.ListCount ListBox2.ListIndex = 0 Do While xcount 1 If ListBox2.Selected(i) = True Then Worksheets("HistoricalFS").Cells(11 + number, 2) ListBox2.List(i) ListBox2.RemoveItem (i) End If number = number + 1 xcount = xcount - 1 Loop End Su -- toocol ----------------------------------------------------------------------- toocold's Profile: http://www.excelforum.com/member.php...fo&userid=3160 View this thread: http://www.excelforum.com/showthread.php?threadid=52971 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to open without losing data? | Excel Discussion (Misc queries) | |||
Losing Data | Excel Discussion (Misc queries) | |||
losing data / formatting.. | Excel Discussion (Misc queries) | |||
transfer one worksheet to another worksheet without losing format. | Excel Worksheet Functions | |||
Losing data when converting | Excel Programming |