Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Subtotal use macro to Sumif

Hi,

I have a basic macro to run the subtotal in Excel, but I need to use a "SUMIF" instead of the "SUM" function.

I need to SUMIF the numbers in cells if they are greater than 0.01, or SUMs only the positive numbers and leave the negative out.


Sub Subtotal()
'
' Subtotal Macro
'
'
Range("A1").Select
Selection.Subtotal GroupBy:=5, Function:=xlSum, TotalList:=Array(25, 26, 27 _
, 28, 53, 54, 57, 58, 59, 68, 69, 77, 78, 86, 87, 95, 96, 104, 105, 113, 114, 122, 123, 132, 133, 141, _
142, 150, 151, 159, 160), Replace:=True, PageBreaks:=False, SummaryBelowData:= _
True
End Sub


Thanks
Marc
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
Sumif / subtotal / something else? NeedToKnow Excel Discussion (Misc queries) 6 January 17th 09 01:19 AM
Subtotal and sumif help Ellen G. Excel Discussion (Misc queries) 1 November 9th 06 04:32 PM
subtotal and sumif Pete Excel Worksheet Functions 2 June 30th 06 01:46 PM
Sumif & subtotal Blackwar Excel Discussion (Misc queries) 5 December 8th 05 01:11 PM
Subtotal on SumIf Steven Excel Worksheet Functions 1 May 26th 05 12:25 AM


All times are GMT +1. The time now is 10:03 PM.

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"