Macro with formula

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
 
G

Gary''s Student

Sub ordinate()
Range("A1").Value = Application.WorksheetFunction.Sum(Range("B2:B4"))
End Sub
 
O

orquidea

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.
 
D

Dave Peterson

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top