Hi,
I am "starting" to use the macros and I need some help to make it recursive.
Basically I have a first spread sheet with the following columns
A: Issue Date, B: Client Name, C: Object, D: Amount Invoiced, E: Invoice Ref., F: Address, G: ZIP and City
The second sheet is the invoice template and I need to generate as many invoices as there is lines in the data source spread sheet.
I created a macro with which I can only generate 1 invoice at a time:
Sheets("SHEET NAME").Select
Sheets("SHEET NAME").Copy After:=Sheets(PREVIOUS SHEET #)
ActiveWindow.SmallScroll Down:=-3
Range("D11").Select
ActiveCell.FormulaR1C1 = "='[DATA-SOURCE.xlsx]Loyers'!R2C5"
Range("G11").Select
ActiveCell.FormulaR1C1 = "='[DATA-SOURCE.xlsx]Loyers'!R2C1"
Range("D15").Select
ActiveCell.FormulaR1C1 = "='[DATA-SOURCE.xlsx]Loyers'!R2C2"
Range("B16:E16").Select
ActiveCell.FormulaR1C1 = "=''[DATA-SOURCE.xlsx]Loyers'!R2C6"
Range("B17:E17").Select
ActiveCell.FormulaR1C1 = "=''[DATA-SOURCE.xlsx]Loyers'!R2C7"
Range("B18:E18").Select
ActiveWindow.SmallScroll Down:=6
Range("D37:E37").Select
ActiveCell.FormulaR1C1 = "='[DATA-SOURCE.xlsx]Loyers'!R2C4"
Range("D38:E38").Select
ActiveWindow.SmallScroll Down:=3
Sheets("SHEET NAME (2)").Select
Sheets("SHEET NAME").Name = "SHEET NEXT NAME"
Range("F43").Select
Also, the sheets are named the invoice reference (Row E in the data file)
It would be great if anyone could give me some advice as this will save me a LOT of time.
Thanks in advance,
Ben
Bookmarks