Forum Discussion
Record macro range
Hi Sibujoy,
Since I cannot run this macro it is difficult to determine which cells you are referring to. You start out selecting Column U, shifting it to the right, then labeling the new U. Later, you do the same for column V. Where is the "blank" column at that you want to select? Assuming I understand what you are looking for, if, starting with Column U, you named the range and then put the named range in your macro, it will follow the named range when performing the next tasks. To name a range you can select U to highlight the column, then in the upper left box (right above column "A") where it says 'U1' click in that box and type in a name like "START" then press enter. (If it does not take the name, it will remove it and put U1 back in.)
In your macro where you have "U:U" you can now use "START". As another column is placed before column U, the START range will now be in column V and so forth. To see how it is working, you can highlight the START row in some fashion and then when in VBA, under debug, STEP INTO - F8 and run your macro one step at a time to see how this works. Let me know if this helps.