Darren Smith
Well-known Member
- Joined
- Nov 23, 2020
- Messages
- 631
- Office Version
- 2019
- Platform
- Windows
VBA Code:
Private Sub Add_Towbar_to_Jobcard_Click()
Dim r As Long
Dim i As Long
Dim wsDest As Worksheet
Set wsDest = ThisWorkbook.Sheets("Job Card Master")
wsDest.Activate
Sheets("Sheet2").Range("A2:O49").Copy wsDest.Range("A127")
r = 2
For i = 0 To Me.ListBox1.ListCount - 1
If Me.ListBox1.Selected(i) Then
wsDest.Cells(r, 1).Value = Me.ListBox1.List(i, 0)
wsDest.Cells(r, 2).Value = Me.ListBox1.List(i, 1)
wsDest.Cells(r, 3).Value = Me.ListBox1.List(i, 2)
wsDest.Cells(r, 4).Value = Me.ListBox1.List(i, 3)
wsDest.Cells(r, 5).Value = Me.ListBox1.List(i, 4)
r = r + 1
End If
Next
End Sub
Last edited by a moderator: