Macro to insert columns with preserved formulas

archie00

New Member
Joined
Apr 1, 2011
Messages
9
Hi. I posted this a little while ago with no luck. Any new takers??

I need a macro for inserting a column at a prescribed location (i.e. this will vary according to what the user wants). This column needs to have the same formulas as the column to the left. I would like a dialogue box to come up asking (1) at what location would you like the column inserted; and (2) How many columns would you like to insert.

To prevent columns being inserted at locations in the worksheet where they shouldn't be, if possible, I need some error checks in the macro. i.e. if "Cell to Left of insert location"="Name" don't allow a column to be inserted and return error message "Column could not be inserted".

Hope this makes sense.

Cheers
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.

Forum statistics

Threads
1,224,617
Messages
6,179,914
Members
452,949
Latest member
beartooth91

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