Ok so my end game here is to take whatever "row" is selected in the listbox and drop its values into a spreadsheet...
The values will always drop into the same locations so that is given.
I'm not sure what I'm doing wrong...but I have a feeling trying to use an array isn't helping me...
The values will always drop into the same locations so that is given.
Code:
Private Sub btnBlah_Click()
Dim blahvba()
Dim ws As Worksheet
Set ws = ThisWorkbook.Worksheets("Assembly")
With Me.ListBox1
For i = 0 To .ListCount - 1
If .Selected(i) Then
blahvba(i) = .Value
End If
Next i
ws.Cells(1, 7) = blahvba(1)
ws.Cells(1, 2) = blahvba(2)
ws.Cells(1, 1) = blahvba(3)
ws.Cells(1, 3) = blahvba(4)
ws.Cells(1, 4) = blahvba(5)
ws.Cells(1, 5) = blahvba(6)
End With
End Sub
I'm not sure what I'm doing wrong...but I have a feeling trying to use an array isn't helping me...
