Waterpolo1
New Member
- Joined
- Sep 8, 2015
- Messages
- 21
Process so far, the problem one is step 3 only:
1. Get file path of document and populate into a listbox (Code below)
Private Sub CommandButton2_Click()
'GetOpenFile MultiSelect will return an Array if more than one is selected
On Error Resume Next
Dim FilePathArray As Variant
FilePathArray = Application.GetOpenFilename(, , , , MultiSelect:=True)
UserForm.EvidenceListBox.AddItem (FilePathArray(1))
' If IsArray(FilePathArray) Then
Dim ArraySize As Long
ArraySize = UBound(FilePathArray, 1) - LBound(FilePathArray, 1)
Dim ArrayPosition As Long
For ArrayPosition = 1 To ArraySize
If Not FilePathArray(ArrayPosition) = Empty Then
UserForm.EvidenceListBox.AddItem (FilePathArray(ArrayPosition))
End If
Next ArrayPosition
2. Submit data to text box in sheet (Code below)
For i = 0 To EvidenceListBox.ListCount - 1
ws.Range("P" & LastRow).Value = ws.Range("P" & LastRow).Value & " | " & EvidenceListBox.List(i)
Next I
3. PROBLEM ONE - I have a button which when I click, retrieve data from the excel sheet into a lisbox. It finds the right list by finding the right ID. current code which doen't work is below:
EvidenceListBox1.Text = ws.Cells(i, 16)
1. Get file path of document and populate into a listbox (Code below)
Private Sub CommandButton2_Click()
'GetOpenFile MultiSelect will return an Array if more than one is selected
On Error Resume Next
Dim FilePathArray As Variant
FilePathArray = Application.GetOpenFilename(, , , , MultiSelect:=True)
UserForm.EvidenceListBox.AddItem (FilePathArray(1))
' If IsArray(FilePathArray) Then
Dim ArraySize As Long
ArraySize = UBound(FilePathArray, 1) - LBound(FilePathArray, 1)
Dim ArrayPosition As Long
For ArrayPosition = 1 To ArraySize
If Not FilePathArray(ArrayPosition) = Empty Then
UserForm.EvidenceListBox.AddItem (FilePathArray(ArrayPosition))
End If
Next ArrayPosition
2. Submit data to text box in sheet (Code below)
For i = 0 To EvidenceListBox.ListCount - 1
ws.Range("P" & LastRow).Value = ws.Range("P" & LastRow).Value & " | " & EvidenceListBox.List(i)
Next I
3. PROBLEM ONE - I have a button which when I click, retrieve data from the excel sheet into a lisbox. It finds the right list by finding the right ID. current code which doen't work is below:
EvidenceListBox1.Text = ws.Cells(i, 16)