Formula global failure to copy range format down to final row

Jacko1307

Board Regular
Joined
Sep 4, 2012
Messages
92
Office Version
  1. 2016
Platform
  1. Windows
Good morning,

Having a slight problem making excel copy a formula from F2 to FinalRow and keep getting global failure. Code I have so far.
Please can you help me with this conundrum.

Columns("F:F").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("F1").Select
ActiveCell.FormulaR1C1 = "AVG"
Range("F2").Select
ActiveCell.FormulaR1C1 = "=RC[-1]/RC[-2]" (NOT SURE IF THIS IS PROBLEM)
Selection.NumberFormat = "0.00"
Selection.AutoFill Destination:=Range("F2:F" & FinalRow), Type:=xlFillDefault
Range("F2:F").Select
 
Just add this to the end of the code
VBA Code:
    Columns("G:I").ColumnWidth = 25
 
Upvote 0

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,216,361
Messages
6,130,180
Members
449,563
Latest member
Suz0718

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