kaleonard08
New Member
- Joined
- Mar 9, 2016
- Messages
- 8
I am very basic at macros and I need some help.
I recorded the below macro and I need it to repeat but for all the rows. This was just using the record macro button so I did not do all the coding.
A little explanation: I have a table that is a calculator. I have a project that has a range of 3,000 to 5,000 rows that I would need to input the quantity and cost into the calculator. The table is on the "quote" worksheet and has three columns (qty, cost, and resale). I need to input the qty and cost into the calculator on a separate worksheet ("unit resale calculator") which will calculate the resale. Once I have the resale from the calculator, I want to input that back into the third column (resale) on the "quote" worksheet. As mentioned earlier, I recorded the first row in a macro (see below) but I need this macro to keep repeating until all the rows are complete which is an unknown number of times. Hope this is enough information. If additional information is needed, please let me know.
Sub Calculate()
'
' Calculate Macro
'
'
Sheets("Unit Resale Calculator").Select
Range("E9").Select
ActiveCell.FormulaR1C1 = "=Quote!R[-7]C[-4]"
Range("E10").Select
ActiveCell.FormulaR1C1 = "=Quote!R[-8]C[-3]"
Range("E18").Select
Sheets("Quote").Select
Range("C2").Select
ActiveCell.FormulaR1C1 = "='Unit Resale Calculator'!R[16]C[2]"
Range("C3").Select
End Sub
I recorded the below macro and I need it to repeat but for all the rows. This was just using the record macro button so I did not do all the coding.
A little explanation: I have a table that is a calculator. I have a project that has a range of 3,000 to 5,000 rows that I would need to input the quantity and cost into the calculator. The table is on the "quote" worksheet and has three columns (qty, cost, and resale). I need to input the qty and cost into the calculator on a separate worksheet ("unit resale calculator") which will calculate the resale. Once I have the resale from the calculator, I want to input that back into the third column (resale) on the "quote" worksheet. As mentioned earlier, I recorded the first row in a macro (see below) but I need this macro to keep repeating until all the rows are complete which is an unknown number of times. Hope this is enough information. If additional information is needed, please let me know.
Sub Calculate()
'
' Calculate Macro
'
'
Sheets("Unit Resale Calculator").Select
Range("E9").Select
ActiveCell.FormulaR1C1 = "=Quote!R[-7]C[-4]"
Range("E10").Select
ActiveCell.FormulaR1C1 = "=Quote!R[-8]C[-3]"
Range("E18").Select
Sheets("Quote").Select
Range("C2").Select
ActiveCell.FormulaR1C1 = "='Unit Resale Calculator'!R[16]C[2]"
Range("C3").Select
End Sub