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

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

Forum statistics

Threads
1,217,302
Messages
6,135,721
Members
449,959
Latest member
choy96

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