hi ,
i have a userform with a listbox & i would like to use each list item as a search value for another sheet & use this vlaue to copy data to another sheet.
below is the code i have used for the same scenario for a combo box but i dont know how to incorporate a loop for the listbox.
please could somone help me with this?Dim FlagSH As Worksheet Dim PartSH As Worksheet Dim AddMe As Range Dim FindValue As Range Dim i As Integer Set FlagSH = Sheet6 Set PartSH = Sheet4 FindPart = Me.cboItem.Value Set AddMe = FlagSH.ListObjects("Flag").Range.Columns(4).Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Offset(1, 0) If FindPart <> "" Then Set FindValue = PartSH.Range("A:A").Find(what:=Me.cboItem.Value, LookIn:=xlValues, LookAt:=xlWhole) With FlagSH AddMe.Offset(0, 0).Value = FindValue.Offset(0, 0).Value AddMe.Offset(0, 1).Value = FindValue.Offset(0, 1).Value '''ect, ect end with
thanks




Reply With Quote