asyamonique
Well-known Member
- Joined
- Jan 29, 2008
- Messages
- 1,286
- Office Version
- 2013
- Platform
- Windows
Hello,
Is it possible to populate datas inside cells(starts from K2) instead of listbox with the given sample below code?
Thanks
Is it possible to populate datas inside cells(starts from K2) instead of listbox with the given sample below code?
Code:
[COLOR=#333333]Private Sub CommandButton1_Click()[/COLOR]
Dim r As Long, Ac As Long, c As Long
If ComboBox1.Value <> -1 And ComboBox2.Value <> -1 Then
ListBox1.Clear
With Worksheets("reports").Range("A1:A1000")
ReDim Ray(1 To .Count, 1 To 6)
For r = 1 To .Rows.Count
With ListBox1
.ColumnCount = 6
.ColumnWidths = "0;0;80;350;100;100"
End With
If ComboBox1.Value = .Cells(r, 1).Value And ComboBox2.Value = .Cells(r, 2).Value Then
c = c + 1
For Ac = 1 To 6
Ray(c, Ac) = .Cells(r, Ac)
Next Ac
End If
Next r
End With
End If
ListBox1.list = Ray
[COLOR=#333333]End Sub[/COLOR]