View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] ucanalways@gmail.com is offline
external usenet poster
 
Posts: 115
Default Macro for recurring formula; max of set of cells

Hello Group,

I am trying to automate this using a macro. I am trying to populate
the values of set of cells with a single click of a command button.
I tried FOR loop and all I get is just errors. Could someone please
help me to write a macro for the following:

Case 1:
'Max of interval 18
Formula in cell D1 =max(E2:E19)
Formula in cell D2 =max(E20:E37)
Formula in cell D3 =max(E38:E55)
......
Formula in cell D117......

Case2:
'Max of interval 18 - Mid value of interval 18
Formula in cell G1 =(max(F2:F19) - F10)
Formula in cell G2 =max(F20:F37) - F28)
Formula in cell G3 =max(F38:F55) - F46)
......
Formula in cell D117.....

Any help would be much appreciated.

Thanks,
Kevin