Hi All,
When i am running the below macro the results is something wierd. The formulae wise it is calculating thngs correctly but the columns from J to O are not getting values. they are getting populated as balnk but the P column is getting the value , can u please suggest what i did wrong and how to rectify it .
I tried the alternate way also but still this is not working . The issue is why the Columns from J to O are coming as blank while P is having correct values as per formulae.
When i am running the below macro the results is something wierd. The formulae wise it is calculating thngs correctly but the columns from J to O are not getting values. they are getting populated as balnk but the P column is getting the value , can u please suggest what i did wrong and how to rectify it .
Code:
Sub Dyn()
'
' Dyn Macro
'
'
Dim strRng As Long
Range("J3").Select
ActiveCell.FormulaR1C1 = "=ABS(R[-1]C[-5]-R[-2]C[-5])"
Range("K4").Select
ActiveCell.FormulaR1C1 = "=R[-2]C[-6]"
Range("L4").Select
ActiveCell.FormulaR1C1 = "=ABS(RC[-7]-R[-2]C[-7])"
Range("M4").Select
ActiveCell.FormulaR1C1 = "=RC[-1]/(3*SUM(R[-2]C[-3]:RC[-3]))"
Range("N4").Select
ActiveCell.FormulaR1C1 = "=RC[-1]*(0.3816-0.2319)+0.2319"
Range("O4").Select
ActiveCell.FormulaR1C1 = "=RC[-1]*RC[-1]"
Range("P4").Select
ActiveCell.FormulaR1C1 = "=R[-1]C+(RC[-1]*(RC[-11]-R[-1]C))"
Range("P5").Select
strRng = Range("A" & Rows.Count).End(xlUp).Row
Range("J3:P3").AutoFill Destination:=Sheets("Sheet2").Range("J3:P" & strRng)
End Sub
I tried the alternate way also but still this is not working . The issue is why the Columns from J to O are coming as blank while P is having correct values as per formulae.
Code:
Sub Dyn()
'
' Dyn Macro
'
'
Dim strRng As Long
Range("J4").FormulaR1C1 = "=ABS(R[-1]C[-5]-R[-2]C[-5])"
Range("K4").FormulaR1C1 = "=R[-2]C[-6]"
Range("L4").FormulaR1C1 = "=ABS(RC[-7]-R[-2]C[-7])"
Range("M4").FormulaR1C1 = "=RC[-1]/(3*SUM(R[-2]C[-3]:RC[-3]))"
Range("N4").FormulaR1C1 = "=RC[-1]*(0.3816-0.2319)+0.2319"
Range("O4").FormulaR1C1 = "=RC[-1]*RC[-1]"
Range("P4").FormulaR1C1 = "=R[-1]C+(RC[-1]*(RC[-11]-R[-1]C))"
strRng = Range("A" & Rows.Count).End(xlUp).Row
Range("J3:P3").AutoFill Destination:=Sheets("Sheet2").Range("J3:P" & strRng)
End Sub
Last edited: