View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Les Stout[_2_] Les Stout[_2_] is offline
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 ***