Running a macro in different cells [Solved/Closed]

 sd -
I have a question. I recorded a macro to average a series of columns, highlight the averages row in a bold color. I would now like to run the macro in seven different rows so I don't have to keep copying and pasting the formula etc. But everytime I run the macro, it runs it in the same row where I created the maco (i.e., row 32, instead of 48, then 64 etc) . How do I create a generic macro that is non-specific to the row number? Is that possible? There are other macros I would like to create that would generate the same problem, so I would very much appreciate help understanding how this works,
Thanks much,

2 replies

Registration date
Sunday June 14, 2009
Last seen
July 30, 2015
If you want to do for all the required rows put the codes in a loop. If you want to do only in one or two rows put an input box.

post the code and modification can be suggested.
Thank you

A few words of thanks would be greatly appreciated. Add comment

CCM 2942 users have said thank you to us this month

When you star recording a macro right after you create the name a Stop recording toolbar appears, in it is a relative button, click it, make sure a border is around it, this will let you select a relative cell or a relative range of cells, all other procedures are the same.
I hope this helps

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!