Hi I have been trying to work through this macro based on other posts I have found but I am very new to this and couldn't make it work. It think this should be very easy but I just can not figure it out.
I have to generate several hundred invoices by hand, and I have the fields that I need (name, email, amount owed, etc...) on the invoice template (Sheet2) pulling from the data sheet on "Student_Information" (Sheet1) to populate the invoice template. I need a macro that will move each of these fields down by one cell each time the macro is on the data sheet ("Student_Information") to reflect the appropriate information so that I can generate a PDF invoice.
In my invoice template (Sheet 2) here are the formulas and the cells they are referencing. The data begins on row 3 on Sheet1 and goes until about row 210.
1- E4 - =Student_Information!B3
2- A11 - =Student_Information!C3
3- A12 - ="UNID: "&Student_Information!B3
4- A13 - =Student_Information!H3
5- A14 - =Student_Information!I3
6- E18 - =-Student_Information!K3
7- E19 - =-Student_Information!N3
I recorded a macro that will change from the first student on the list to the second (code below), but after I create that invoice I need it to then move to the third, fourth, fifth... student once the invoice is generated. Currently this is what I have:
Sub changeformulas()
'
' changeformulas Macro
'
'
Range("E4").Select
ActiveCell.FormulaR1C1 = "=Student_Information!RC[-3]"
Range("A11").Select
ActiveCell.FormulaR1C1 = "=Student_Information!R[-7]C[2]"
Range("A12").Select
ActiveCell.FormulaR1C1 = "=""UNID: ""&Student_Information!R[-8]C[1]"
Range("A13").Select
ActiveCell.FormulaR1C1 = "=Student_Information!R[-9]C[7]"
Range("A14").Select
ActiveCell.FormulaR1C1 = "=Student_Information!R[-10]C[8]"
Range("E18").Select
ActiveCell.FormulaR1C1 = "=-Student_Information!R[-14]C[6]"
Range("E19").Select
ActiveCell.FormulaR1C1 = "=-Student_Information!R[-15]C[9]"
Range("E20").Select
End Sub
Thank you for your help in advance!!!!!
I have to generate several hundred invoices by hand, and I have the fields that I need (name, email, amount owed, etc...) on the invoice template (Sheet2) pulling from the data sheet on "Student_Information" (Sheet1) to populate the invoice template. I need a macro that will move each of these fields down by one cell each time the macro is on the data sheet ("Student_Information") to reflect the appropriate information so that I can generate a PDF invoice.
In my invoice template (Sheet 2) here are the formulas and the cells they are referencing. The data begins on row 3 on Sheet1 and goes until about row 210.
1- E4 - =Student_Information!B3
2- A11 - =Student_Information!C3
3- A12 - ="UNID: "&Student_Information!B3
4- A13 - =Student_Information!H3
5- A14 - =Student_Information!I3
6- E18 - =-Student_Information!K3
7- E19 - =-Student_Information!N3
I recorded a macro that will change from the first student on the list to the second (code below), but after I create that invoice I need it to then move to the third, fourth, fifth... student once the invoice is generated. Currently this is what I have:
Sub changeformulas()
'
' changeformulas Macro
'
'
Range("E4").Select
ActiveCell.FormulaR1C1 = "=Student_Information!RC[-3]"
Range("A11").Select
ActiveCell.FormulaR1C1 = "=Student_Information!R[-7]C[2]"
Range("A12").Select
ActiveCell.FormulaR1C1 = "=""UNID: ""&Student_Information!R[-8]C[1]"
Range("A13").Select
ActiveCell.FormulaR1C1 = "=Student_Information!R[-9]C[7]"
Range("A14").Select
ActiveCell.FormulaR1C1 = "=Student_Information!R[-10]C[8]"
Range("E18").Select
ActiveCell.FormulaR1C1 = "=-Student_Information!R[-14]C[6]"
Range("E19").Select
ActiveCell.FormulaR1C1 = "=-Student_Information!R[-15]C[9]"
Range("E20").Select
End Sub
Thank you for your help in advance!!!!!