VBA Loop help

amxtomzo

Active Member
Joined
Nov 7, 2009
Messages
312
thank you or taking the time to help me out.
I am trying to usee VBA to copy and paste a formula down a column to the last row used row. But i seem to hit a snag.
This is my code, if anyone can help that would be great.

Sub COPYPRODUCTIONGOALS()
Worksheets("CENTRAL").Select
Range("i2").Select
ActiveCell.FormulaR1C1 = "=(RC[-3]*100)+RC[-2]"

FinalRow = Worksheets("CENTRAL").Cells(Rows.Count, 1).End(xlUp).Row
For I = 2 To FinalRow

Worksheets("CENTRAL").Cells(I, 9).Resize(1, 1).Copy
Worksheets("CENTRAL").Cells(NextRow, 9).Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
NextRow = NextRow + 1
Next I

End Sub

thanks again

Thomas
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Thomas

Where is the formula you want to copy?

Code:
Worksheet("Central").Range("I2:I" & LastRow).FormulaR1C1 = ""=(RC[-3]*100)+RC[-2]"
 
Upvote 0

Forum statistics

Threads
1,224,506
Messages
6,179,159
Members
452,892
Latest member
yadavagiri

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top