LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default userform multiselect listbox problem


Thanks Tom

in the interim i came up with this code which seems to work although
from a technical point of view is probably not the best solution. I
will test your code and see how it goes

'copy data to database


For lItem = 0 To lbManifestCurrent.ListCount - 1
If lbManifestCurrent.Selected(lItem) = True Then
With ws1
Dim lRow As Long
lRow = ws1.Range("a65536").End(xlUp).Row
For i = lRow To 11 Step -1
If Cells(i, 3).Value =
lbManifestCurrent.List(lItem) Then
Set rng = Worksheets("Freight Accrual History")
_
..Cells(Rows.Count, 1).End(xlUp)(2)
Rows(i).EntireRow.Copy rng
Cells(i, 7).Value = "x"
Exit For
End If

Next i
End With

lbManifestCurrent.Selected(lItem) = False
End If
Next

'delete rows transferred from current to history

For i = lRow To 11 Step -1
If Cells(i, 7).Value = "x" Then
Rows(i).EntireRow.Delete
End If
Next i

this way it was not altering my listbox until all of the selected
listbox items had been placed into history


--
apndas
------------------------------------------------------------------------
apndas's Profile: http://www.excelforum.com/member.php...o&userid=36137
View this thread: http://www.excelforum.com/showthread...hreadid=564054



 
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
Multiselect Listbox use RKS Excel Discussion (Misc queries) 1 May 12th 06 03:04 PM
Bug in multiselect listbox? Jos Vens[_2_] Excel Programming 2 February 8th 06 08:41 PM
MultiSelect ListBox StephanieH Excel Programming 5 November 20th 04 12:29 AM
Multiselect Listbox Francis Ang[_3_] Excel Programming 0 October 27th 04 02:21 AM
multiselect listbox CG Rosén Excel Programming 2 December 28th 03 05:17 PM


All times are GMT +1. The time now is 06:45 PM.

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"