in the attached file, I drafted a userform "PANDL" (which is actually the copy of the page 2 of the userform "cargo2016").
In this userform I would have like to be able to select several ref and to populate the userform with infos for each of them..
But my knowledge in VBA is null and I don't know how to say for each selected item in the listbox "REF", get datas.....
I tried to put a "ok" command to validate the selection in REF listbox with following code...
Private Sub cmdOkay_Click()
Dim i As Long, msg As String, Check As String
'Generate a list of the selected items
For i = 0 To Me.REF.ListCount - 1
If Me.REF.Selected(i) Then
GetData
End If
Next i
If msg = vbNullString Then
'If nothing was selected, tell user and let them try again
MsgBox "Nothing was selected! Please make a selection!"
Exit Sub
Else
'Ask the user if they are happy with their selection(s)
Check = MsgBox("You selected:" & vbNewLine & msg & vbNewLine & _
"Are you happy with your selections?", _
vbYesNo + vbInformation, "Please confirm")
End If
If Check = vbYes Then
GetData
Else
'User wants to try again, so clear listbox selections and
'return user to the userform
For i = 0 To REF.ListCount - 1
REF.Selected(i) = False
Next
End If
End Sub
but obviously the ref.value remain "null".....
can someone give me some tips to search further?
Bookmarks