Help w/ simply Macro (delete cells and re-spread formulas)

Solaxun

New Member
Joined
Dec 4, 2012
Messages
2
I have a form control button I am trying to use to delete a range of cells and refill, but I do not want the formula references to shift if I add rows/columns. I am aware of naming the range but I cannot think of an appropriate way to apply that fix in this scenario.

Ideally I would like to do something as simple as "delete I20:J20" , then "undo" but obviously you can't undo within a macro as far as I know. What I have resorted to is deleting this range, then retyping the formulas (using record macro because I am way too amateur for writing VBA). However since I have to retype the formula in the first cell of the row before spreading it right, the named range solution is of little use as the individual cells that i re-type the formula in do not utilize the named range, only the initial deletion does.

How can I implement this, I find it surprising there is no way to fix cell references within a macro aside from naming the range.
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top