stenlake1
06-27-2007, 04:08 AM
ActiveCell.FormulaR1C1 = _
"=IF(OR(RC1="""",R[-1]C1=""""),"""",((RC[-2]-R[-1]C[-2])*(RC[-2]-R[-1]C[-2])))"
Range("G3").Select
ActiveCell.FormulaR1C1 = _
"=IF(OR(RC1="""",R[-1]C1=""""),"""",((RC[-2]-R[-1]C[-2])*(RC[-2]-R[-1]C[-2])))"
Range("H3").Select
ActiveCell.FormulaR1C1 = _
"=IF(OR(RC1="""",R[-1]C1=""""),"""",((RC[-2]-R[-1]C[-2])*(RC[-2]-R[-1]C[-2])))"
Range("I3").Select
ActiveCell.FormulaR1C1 = _
"=IF(OR(RC1="""",R[-1]C1=""""),"""",(SQRT(RC[-2]+RC[-1])))"
Range("J3").Select
ActiveCell.FormulaR1C1 = "=IF(OR(RC1="""",R[-1]C1=""""),"""",(RC[-1]/1000))"
Range("K3").Select
ActiveCell.FormulaR1C1 = _
"=IF(OR(RC1="""",R[-1]C1=""""),"""",((RC[-9]-R[-1]C[-9])/10))"
Range("L3").Select
ActiveCell.FormulaR1C1 = "=IF(OR(RC1="""",R[-1]C1=""""),"""",(RC[-1]-RC[-2]))"
Range("M3").Select
ActiveCell.FormulaR1C1 = _
"=IF(OR(RC1="""",R[-1]C1=""""),"""",((RC[-2]-RC[-3])/RC[-2])*100)"
Range("G3:M3").Select
Selection.AutoFill Destination:=Range("G3:M1504"), Type:=xlFillDefault
I have a problem. For the highlighted line in green - I currently have: RC[-9]-R[-1]C[-9])/10). I now need to change it so there is a user inputted variable so i would get: (RC[-9]-R[-1]C[-9])*<User value>)/1000. Any easy way of doing this? The other problem is that the user value might change down the sheet! ahhhh!
"=IF(OR(RC1="""",R[-1]C1=""""),"""",((RC[-2]-R[-1]C[-2])*(RC[-2]-R[-1]C[-2])))"
Range("G3").Select
ActiveCell.FormulaR1C1 = _
"=IF(OR(RC1="""",R[-1]C1=""""),"""",((RC[-2]-R[-1]C[-2])*(RC[-2]-R[-1]C[-2])))"
Range("H3").Select
ActiveCell.FormulaR1C1 = _
"=IF(OR(RC1="""",R[-1]C1=""""),"""",((RC[-2]-R[-1]C[-2])*(RC[-2]-R[-1]C[-2])))"
Range("I3").Select
ActiveCell.FormulaR1C1 = _
"=IF(OR(RC1="""",R[-1]C1=""""),"""",(SQRT(RC[-2]+RC[-1])))"
Range("J3").Select
ActiveCell.FormulaR1C1 = "=IF(OR(RC1="""",R[-1]C1=""""),"""",(RC[-1]/1000))"
Range("K3").Select
ActiveCell.FormulaR1C1 = _
"=IF(OR(RC1="""",R[-1]C1=""""),"""",((RC[-9]-R[-1]C[-9])/10))"
Range("L3").Select
ActiveCell.FormulaR1C1 = "=IF(OR(RC1="""",R[-1]C1=""""),"""",(RC[-1]-RC[-2]))"
Range("M3").Select
ActiveCell.FormulaR1C1 = _
"=IF(OR(RC1="""",R[-1]C1=""""),"""",((RC[-2]-RC[-3])/RC[-2])*100)"
Range("G3:M3").Select
Selection.AutoFill Destination:=Range("G3:M1504"), Type:=xlFillDefault
I have a problem. For the highlighted line in green - I currently have: RC[-9]-R[-1]C[-9])/10). I now need to change it so there is a user inputted variable so i would get: (RC[-9]-R[-1]C[-9])*<User value>)/1000. Any easy way of doing this? The other problem is that the user value might change down the sheet! ahhhh!