Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel sum function IN VBA

HI ,

Is it possible to use the excel sum function in VBA? I recorded a macro to
with Excel sum, Then I changed the row number and tried to run from VBA. It
seems that it didnt run.

Any help will be greatly appreciated.

Arefin


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 837
Default Excel sum function IN VBA

Current versions will recognize
Application.Sum()
WorksheetFunction.Sum()
Application.WorksheetFunction.Sum()

Some older versions will only recognize
Application.Sum()

Jerry

Robin Hammond wrote:

This is probably what you want

Sub Sum()
MsgBox (Application.WorksheetFunction.Sum(Sheets(1).Range ("a1:a2")))
End Sub

Robin Hammond
www.enhanceddatasystems.com
Check out our XspandXL add-in

"Sobhani Hafiz" wrote in message
...

HI ,

Is it possible to use the excel sum function in VBA? I recorded a macro to
with Excel sum, Then I changed the row number and tried to run from VBA.

It

seems that it didnt run.

Any help will be greatly appreciated.

Arefin


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Excel sum function IN VBA

Added comment:
Older versions being xl5 and xl95. WorksheetFunction was introduced in
xl97.

--
Regards,
Tom Ogilvy

"Jerry W. Lewis" wrote in message
...
Current versions will recognize
Application.Sum()
WorksheetFunction.Sum()
Application.WorksheetFunction.Sum()

Some older versions will only recognize
Application.Sum()

Jerry




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 575
Default Excel sum function IN VBA

This is probably what you want

Sub Sum()
MsgBox (Application.WorksheetFunction.Sum(Sheets(1).Range ("a1:a2")))
End Sub

Robin Hammond
www.enhanceddatasystems.com
Check out our XspandXL add-in

"Sobhani Hafiz" wrote in message
...
HI ,

Is it possible to use the excel sum function in VBA? I recorded a macro to
with Excel sum, Then I changed the row number and tried to run from VBA.

It
seems that it didnt run.

Any help will be greatly appreciated.

Arefin




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
Excel Data Validation/Lookup function does function correcty Kirkey Excel Worksheet Functions 2 May 25th 09 09:22 PM
copy of excel file not showing formulal/function in the function b oaallam Excel Discussion (Misc queries) 4 September 6th 07 01:20 PM
challenge! javascript function into excel function Kamila Excel Worksheet Functions 2 February 19th 07 06:35 AM
When I Import an Access Table With an Excel Function in a Cell it Displays as Text not as a Function in Excel Niek Otten Excel Programming 2 September 18th 03 03:55 AM
Excel - saving result of a function without showing the function Moshe Excel Programming 1 August 30th 03 08:41 PM


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

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

About Us

"It's about Microsoft Excel"