Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Public Sub ProcessData()
Dim LastRow As Long Dim LastCol As Long With ActiveSheet LastRow = .Cells(.Rows.Count, "B").End(xlUp).Row LastCol = .Cells(10, .Columns.Count).End(xlToLeft).Column With .Cells(LastRow + 1, "B").Resize(, LastCol - 1) .Formula = "=AVERAGE(B10:B" & LastRow & ")" .NumberFormat = "0.0" End With End With End Sub -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "VistaOnMyMac :)" wrote in message ... Bob, Thank you so much. It worked great! How would I add formatting tasks to the same cells. For example: .NumberFormat = "0.0" |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Calculating an average | Excel Worksheet Functions | |||
Calculating Average | Excel Discussion (Misc queries) | |||
Calculating an average using VBA | Excel Programming | |||
Calculating the average | Excel Discussion (Misc queries) | |||
Calculating Average on variable sized datasets w/VBA | Excel Programming |