'set rng = Range(cells(1,1),Cells(1,1).End(xldown)
set rng = Selection
ave = Application.Average(rng)
stdev = Application.Stdev(rng)
for each cell in rng
if cell.Value ave+stdev or cell.value < cell-stdev then
cell.Value = 0
end if
Next
or if you want to change the values within 1 std dev
If cell.value < ave + stdev and cell.Value ave - stdev then
Your stated criteria doesn't make any sense:
(daat average+divation AND data <
average + diviation)
--
Regards,
Tom Ogilvy
dilsenahin wrote in message
...
Hi,
i want to write some code that will do the following.
if i select some numerical data in the excel column, the program should
find out the average and standard deviation of the selected data. then
it should put "0" in the column if (daat average+divation AND data <
average + diviation) otherwise it should keep the original data. it is
not necessary to see the standard deviation.
hope you understand what i want to do.
dilse.
---
Message posted from http://www.ExcelForum.com/