This should help you get started.
Range.Formula property on MSDN
Range.AutoFill method on MSDN
With Activesheet.Range("AR8")
.Formula = "=ROUND(IF(AP8>(AN8*P8),AP8,AN8*P8),2)"
.AutoFill Destination:=.Resize(100), Type:=xlFillDefault
End With
0
solved Round cells then auto fill VBA