View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
sebastienm sebastienm is offline
external usenet poster
 
Posts: 694
Default example using DSUM worksheet function in a VBA function

Hi,

MsgBox Application.WorksheetFunction.DSum(Range("A1:D8"), Range("C1"),
Range("G3:G4"))

with:
- the table (headers + data): A1:D8
- the sum field header in C1 (here 'Data')
- the criteria as G3 being the header name (here 'Description') and G4 the
filter value for that header (here 'Gasket')

returns the correct value in my case.
--
Regards,
Sébastien
<http://www.ondemandanalysis.com


"excelman" wrote:

Does anyone have sample code of using
WorksheetFunction.DSum(rDB, rColumn, rCriteria) in a VBA function?