F
ferrdav
good morning,
i've this problem.
i need a method to count the number og elemnts i get in a column, let
say column A and use this number to set the range for my formulas and
loop.
i tried this:
dim h as integer
Range("M2").Select
ActiveCell.FormulaR1C1 = "=IF(R[-1]C[-12]=0,0,1)"
Selection.AutoFill destination:=Range("M2:M15000")
Range("M15001").Select
h = ActiveCell.FormulaR1C1 = "=SUM(R[-14999]C:R[-1]C)"
(whit this formula, in column M, i set 1 if there is an value in A else
0. then h is the sum on all the values in Column M.)
and then
Range("G2").Select
ActiveCell.FormulaR1C1 = "=RC[-5]*RC[-3]"
Range("G2").Select
Selection.AutoFill destination:=Range(.Cells(7, 2), .Cells(7, h))
or also
Range("G2").Select
ActiveCell.FormulaR1C1 = "=RC[-5]*RC[-3]"
Range("G2").Select
Selection.AutoFill destination:=Range("g2:gh")
but it does not work.
what i'm wrong?
thank's in advance
i've this problem.
i need a method to count the number og elemnts i get in a column, let
say column A and use this number to set the range for my formulas and
loop.
i tried this:
dim h as integer
Range("M2").Select
ActiveCell.FormulaR1C1 = "=IF(R[-1]C[-12]=0,0,1)"
Selection.AutoFill destination:=Range("M2:M15000")
Range("M15001").Select
h = ActiveCell.FormulaR1C1 = "=SUM(R[-14999]C:R[-1]C)"
(whit this formula, in column M, i set 1 if there is an value in A else
0. then h is the sum on all the values in Column M.)
and then
Range("G2").Select
ActiveCell.FormulaR1C1 = "=RC[-5]*RC[-3]"
Range("G2").Select
Selection.AutoFill destination:=Range(.Cells(7, 2), .Cells(7, h))
or also
Range("G2").Select
ActiveCell.FormulaR1C1 = "=RC[-5]*RC[-3]"
Range("G2").Select
Selection.AutoFill destination:=Range("g2:gh")
but it does not work.
what i'm wrong?
thank's in advance