LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 396
Default Help to modify code

Hi all, i have the code below (Compliments Peter T) that is doing what i
want it to. On hindsight i do not need to show the month with every
list, but just the total. How would i modify the code to show just the
total and not the month ???

Sub test()
Dim arrTotals(1 To 12, 1 To 2) As Double
Dim arr, i As Integer, m As Variant

With Range("G6")
arr = .Resize(.End(xlDown).Row - .Row + 1, 2)
End With

For i = 1 To UBound(arr)
m = Month(arr(i, 1))
arrTotals(m, 2) = arrTotals(m, 2) + arr(i, 2)
Next

For i = 1 To 12
arrTotals(i, 1) = i
Next


Range("O1:P12").Value = arrTotals<-Inserts month and total

End Sub

Best regards,

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***
 
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
Modify code bigmaas Excel Discussion (Misc queries) 2 February 16th 10 10:51 AM
Modify Code Richard Excel Worksheet Functions 0 March 13th 08 08:19 PM
almost there ... code modify help Ray Excel Programming 1 March 29th 07 12:58 PM
Modify code in UDF Biff Excel Programming 9 August 31st 05 04:41 AM
How to modify VBA code for Add-in? Shetty Excel Programming 1 March 3rd 04 04:04 PM


All times are GMT +1. The time now is 12:28 PM.

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"