ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Average macro/program (https://www.excelbanter.com/excel-programming/319472-average-macro-program.html)

Christopher Anderson

Average macro/program
 
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 would also like it to give an error message if there are
cells with text rather than numbers.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


Nick Hodge

Average macro/program
 
Christopher

Apart from the error bit, you can select any area and right-click in the
status bar and select Average. This will give you a running total of any
selection.

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS


"Christopher Anderson" wrote
in 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 would also like it to give an error message if there
are
cells with text rather than numbers.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





All times are GMT +1. The time now is 05:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com