Macro with formula

  • Thread starter Thread starter orquidea
  • Start date Start date
O

orquidea

Hi

How do I have to code the below procedure in a macro properly?

ATLN40 = "=Sum(B2:B4)"

I want to diplay the result in other cell. I have the following code:
Range("A1").Value= ATLN40 & " - 20's"
What I am getting now in Range A1 is =Sum(B2:B4) - 20's , not the
result of the sum.

Could anyone help me please?

Thanks,
Orquidea
 
Sub ordinate()
Range("A1").Value = Application.WorksheetFunction.Sum(Range("B2:B4"))
End Sub
 
Thanks Gary.

I will still need the variable ATLN40 = (the total of the sum). I will need
the total for other calculations. I will refer to ATLN40.
 
Check your other thread.
Hi

How do I have to code the below procedure in a macro properly?

ATLN40 = "=Sum(B2:B4)"

I want to diplay the result in other cell. I have the following code:
Range("A1").Value= ATLN40 & " - 20's"
What I am getting now in Range A1 is =Sum(B2:B4) - 20's , not the
result of the sum.

Could anyone help me please?

Thanks,
Orquidea
 
Back
Top