ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   xl macro (https://www.excelbanter.com/excel-programming/301518-xl-macro.html)

MCB

xl macro
 
How do i write a macro that will move to each cell in a
column and, if the value meets a certain "IF" requirement,
select it and add it to the data range for the "average
function" to evaluate? (for xl 97)

JWolf

xl macro
 
How about using worksheet functions to calculate average as follows:

=SUMIF(A1:A1000,"apples")/COUNTIF(A1:A1000,"apples")

mcb wrote:

How do i write a macro that will move to each cell in a
column and, if the value meets a certain "IF" requirement,
select it and add it to the data range for the "average
function" to evaluate? (for xl 97)


MCB

xl macro
 
JWolf,

Thanks a million for your help. I didn't know those
functions existed. It sure simplified things didn't it?
You saved me a lot of grief!

Thanks again,
mcb



-----Original Message-----
How about using worksheet functions to calculate average

as follows:

=SUMIF(A1:A1000,"apples")/COUNTIF(A1:A1000,"apples")

mcb wrote:

How do i write a macro that will move to each cell in a
column and, if the value meets a certain "IF" requirement,
select it and add it to the data range for the "average
function" to evaluate? (for xl 97)

.



All times are GMT +1. The time now is 10:03 PM.

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