ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro Help (https://www.excelbanter.com/excel-programming/397268-macro-help.html)

paul/bones[_2_]

Macro Help
 
I have a set of data that looks like this but with many more rows of data
LIRI RIRI L-Rut R-Rut AvgLIRI
1.05 1.03 2 1 1.42
1.18 0.59 2 2
1.76 1.29 3 3
1 0.99 3 3
0.59 0.95 2 2 1.53
I have a macro that will count through the first 4 rows of LIRI and will
calculate the average over this interval. The original macro is without
truncation so that when i select the first cell in AvgLIRI for the second 4
values of LIRI the cell # will be appropriate to calculate the average for
the next 4 values. The problem I am having is that I need a macro that will
then take all the values the previous macro found to transfer these values to
a second sheet without the gaps between each value.

joel

Macro Help
 
Why don't you do the writes to the 2nd sheet at the same time you are writing
the dataz to the 1st sheet

RowCount = 1 'add
old loop

sheets("Sheet2").cells(RowCount,"A").value = FourRowAverage
RowCount = RowCount + 1
end of loop

"paul/bones" wrote:

I have a set of data that looks like this but with many more rows of data
LIRI RIRI L-Rut R-Rut AvgLIRI
1.05 1.03 2 1 1.42
1.18 0.59 2 2
1.76 1.29 3 3
1 0.99 3 3
0.59 0.95 2 2 1.53
I have a macro that will count through the first 4 rows of LIRI and will
calculate the average over this interval. The original macro is without
truncation so that when i select the first cell in AvgLIRI for the second 4
values of LIRI the cell # will be appropriate to calculate the average for
the next 4 values. The problem I am having is that I need a macro that will
then take all the values the previous macro found to transfer these values to
a second sheet without the gaps between each value.



All times are GMT +1. The time now is 09:03 AM.

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