Sub MM1()
Dim lc As Integer, x As Double
lc = Cells(1, Columns.Count).End(xlToLeft).Column 'change the row number to the row you need instead of 1
x = Application.WorksheetFunction.Average(Range(ActiveCell.Offset(0, 2), ActiveCell.Offset(0, lc)))
MsgBox x
End Sub
Maybe, assuming your average is in row 1
Code:Sub MM1() Dim lc As Integer, x As Double lc = Cells(1, Columns.Count).End(xlToLeft).Column 'change the row number to the row you need instead of 1 x = Application.WorksheetFunction.Average(Range(ActiveCell.Offset(0, 2), ActiveCell.Offset(0, lc))) MsgBox x End Sub
Associate Name | Client Name | YTD | W1 | W2 | W3 | |
John | 9100.00% | 100.00% | 100.00% | |||
Edwin | 123.21% | 100.00% | ||||
Lewis | 120.59% | 100.00% | ||||
David | 114.72% | 100.00% | ||||
roger | 110.57% | 100.00% | 100.00% | |||
edwin | 95.44% | 100.00% | 100.00% |