#1   Report Post  
Christopher Anderson
 
Posts: n/a
Default Average Macro

I am not very familiar with the syntax to write macros. If someone could
give me a step by step on how to do this I would really appreciate it.

I want to be able to highlight any group of cells in a worksheet and run a
macro that will calculate the average of the cell values. I want this
average value to pop up in a small window that I can immediately close and do
again and again. I realize that this will probably require some programming
in VB. It seems relatively simple but I am not familiar enough with VB to
figure it out on my own.

ANY help would be greatly appreciated.

-CRA
  #2   Report Post  
Jason Morin
 
Posts: n/a
Default

You can accomplish this without VBA. Right-click on the
status bar at the bottom right-hand corner of your Excel
window and select "Average". Now select your range of
cells. The average will appear.

HTH
Jason
Atlanta, GA


-----Original Message-----
I am not very familiar with the syntax to write macros.

If someone could
give me a step by step on how to do this I would really

appreciate it.

I want to be able to highlight any group of cells in a

worksheet and run a
macro that will calculate the average of the cell

values. I want this
average value to pop up in a small window that I can

immediately close and do
again and again. I realize that this will probably

require some programming
in VB. It seems relatively simple but I am not familiar

enough with VB to
figure it out on my own.

ANY help would be greatly appreciated.

-CRA
.

  #3   Report Post  
Art
 
Posts: n/a
Default

Try this:

Sub mAverage()
Dim CellValue As Range
Dim RunningTotal As Double
For Each CellValue In Selection
RunningTotal = RunningTotal + CellValue
Next CellValue
If Selection.Count 0 Then
MsgBox (RunningTotal / Selection.Count)
End If
End Sub

Art

"Christopher Anderson" wrote:

I am not very familiar with the syntax to write macros. If someone could
give me a step by step on how to do this I would really appreciate it.

I want to be able to highlight any group of cells in a worksheet and run a
macro that will calculate the average of the cell values. I want this
average value to pop up in a small window that I can immediately close and do
again and again. I realize that this will probably require some programming
in VB. It seems relatively simple but I am not familiar enough with VB to
figure it out on my own.

ANY help would be greatly appreciated.

-CRA

Reply
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
Record Macro Relative does not work? lbbss Excel Discussion (Misc queries) 3 December 13th 04 08:43 PM
Record Macro Relative does not work? lbbss Excel Discussion (Misc queries) 1 December 13th 04 07:55 PM
Macro and If Statement SATB Excel Discussion (Misc queries) 2 December 3rd 04 04:46 PM
Macro help Jeff Garrett Excel Discussion (Misc queries) 11 December 1st 04 08:47 PM
macro interruption: help!!! mario milani Excel Discussion (Misc queries) 1 November 30th 04 06:02 PM


All times are GMT +1. The time now is 07:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"