Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel Data Validation/Lookup function does function correcty | Excel Worksheet Functions | |||
copy of excel file not showing formulal/function in the function b | Excel Discussion (Misc queries) | |||
challenge! javascript function into excel function | Excel Worksheet Functions | |||
When I Import an Access Table With an Excel Function in a Cell it Displays as Text not as a Function in Excel | Excel Programming | |||
Excel - saving result of a function without showing the function | Excel Programming |