I will try and explain as best as I can..
Basically, the company I work for needs a way to copy the data from a worksheet and paste it into a job card...
At the moment, I have only managed to be able to write the VB so it creates one job card at a time (see below)
[/URL][/IMG]
Using the below userform, the listbox pulls the rows of data from a worksheet.
Is there some sort of Loop where Excel will loop through all rows, copy the relevant data into the job card, and then add a new sheet into a workbook with each individual job card copied.
Hope that makes sense.
Any help appreciated.
Basically, the company I work for needs a way to copy the data from a worksheet and paste it into a job card...
At the moment, I have only managed to be able to write the VB so it creates one job card at a time (see below)
Code:
Sub CreateJobCard()
'Generates job card
wsJob.Range("C2").Value = wsData.Cells(frmMain.lstViewInc.ListIndex + 5, 3)
wsJob.Range("K2").Value = wsData.Cells(frmMain.lstViewInc.ListIndex + 5, 4)
wsJob.Range("A6").Value = wsData.Cells(frmMain.lstViewInc.ListIndex + 5, 2)
wsJob.Range("B6").Value = wsData.Cells(frmMain.lstViewInc.ListIndex + 5, 10)
wsJob.Range("B10").Value = wsData.Cells(frmMain.lstViewInc.ListIndex + 5, 11)
wsJob.Copy
With Application.FileDialog(msoFileDialogSaveAs)
If .show = -1 Then
.Execute
Else
Exit Sub:
End If
End With
ActiveWorkbook.Close
End Sub
Using the below userform, the listbox pulls the rows of data from a worksheet.
Is there some sort of Loop where Excel will loop through all rows, copy the relevant data into the job card, and then add a new sheet into a workbook with each individual job card copied.
Hope that makes sense.
Any help appreciated.