Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default execute formula

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default execute formula

On Nov 5, 9:41 am, 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.


This works fine in Excel 2000 (9.0.6926 SP-3)
Cell F27 ends up =SUM(F7:F24)

Try building the formula by hand in cell F27, or stepping through your
function in the visual basic debugger. There may be some variance
from your version of Excel to mine.

Brian Herbert Withun


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need VB formula to execute form dave Excel Worksheet Functions 2 January 24th 12 08:39 PM
Excel Formula Doesn't Execute (Shows formula-not the calcuation) Keys1970 Excel Discussion (Misc queries) 4 November 15th 06 02:12 PM
execute once formula tekman[_3_] Excel Programming 0 December 7th 05 05:52 PM
VBA Formula Fails to Execute Patrice Stewart Setting up and Configuration of Excel 1 August 24th 05 09:45 PM
execute a text as a formula Suresh[_4_] Excel Programming 1 April 20th 04 03:42 PM


All times are GMT +1. The time now is 11:07 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"