Thread: execute formula
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
John Bundy John Bundy is offline
external usenet poster
 
Posts: 772
Default execute formula

I copied and pasted your code, it works fine, where did you place the code
and what data do you have in F7:F24?
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"KentAE" wrote:

Hi,

Wy doesn't this sub works? I get "VÄRDEFEL!" (faild value) in Swedish
The formula works in excel after F2 and Enter

Sub Sum()

myCol = "F"
myFirstCell = myCol & "7"
myLastCell = myCol & "24"
myArea = myFirstCell & ":" & myLastCell
mySumCell = myCol & "27"
Range(mySumCell).Activate
txt = "=SUM(" & myArea & ")"
ActiveCell.Formula = txt
ActiveCell.Calculate

End Sub
--
If you are old enough, you have your future behind you.