Make your VBA macros work anywhere: Enable Relative References
Do you know that while recording macros in excel you can use the relative reference based recording so that you can use your macro anywhere and the references would be adjusted automatically?
I have learned this yesterday and I thought it is pretty cool.
Here is how you can make your macro VBA code references relative:
When you select “record new macro” from menu > tools > macros, excel shows a very little macro recording toolbar with a start button and another button. That another button is the one we use to toggle between relative and absolute references in macro code.
And the code generated by relative and absolute references is shown here:
My name is Chandoo. Thanks for dropping by. My mission is to make you awesome in Excel & your work. I live in Wellington, New Zealand. When I am not F9ing my formulas, I cycle, cook or play lego with my kids. Know more about me.
Thank you and see you around.
Leave a Reply
|« Excel Links of the Week – Do you want to run 10k with me edition||What would you like to ask Charley Kyd of Exceluser.com in an interview? »|