How do I get WorsheetFunction.Average to work

Joined
May 30, 2011
Messages
4
Reaction score
0
I found this piece of code and adjusted it to my needs. The only things is that WorksheetFunction.Average does not work. The sum works find but I dont need sum of the value I need Averages. I have tried a couple of things with no avail. Please help and thanks for all your help.:thumb:

This is my code:
Sub CCC()

Dim aArea As Range, i As Integer
For Each aArea In ActiveSheet.UsedRange.SpecialCells(xlCellTypeConstants).Areas
For i = 3 To 3
With Cells(aArea.Row + aArea.Rows.Count, i)
.value = WorksheetFunction.Sum(Range(Cells(aArea.Row, i), Cells(aArea.Row + aArea.Rows.Count - 1, i)))
With .Font
.ColorIndex = 5
.Bold = True
End With
End With
Next i
Next aArea
End Sub
 
Last edited:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top