Excel Macro Needs Help Fast [Closed]

Report
-
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
-
Hello,

I'm currently trying to introduce macros in my reports at work. Everything works fine but there's one thing that I just CAN'T find an answer to. Actually, I'm using the OFFSET function to copy/paste formulas to a specific column (let's say column C) but the problem is that if, someday, someone has to add a column in the sheet. My column C might become column D and the macro won't work.. how can I "Name" that C Column (let's say I name it "Base") so that it will always offset to the column named "Base"?

Any help will be greatly appreciated!

Thx

Max

1 reply

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
you kind of answered your own question. You need to first find the location of that column. Then you can adjust your columns. Other thing you can try is name the whole column a range. In that case if some one insert a column, your named range would move. The best option IMHO is to find where is the column rather than relying on named range.

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!