Macro to insert cells in a column before a selection of cells

meraexcel

New Member
Joined
Dec 8, 2009
Messages
14
Need a Macro for the following problem in Excel:

I have a data of 7x6 in an excel sheet as shown below

A B C D E F G
Ref1 Ref2 Ref3 Ref4 Ref5 Ref6 Ref7
1 1 4 7 6 3
2 3 5 2 3 4
3 5 1 3 8 8
4 7 4 9 5 2
5 6 2 4 2 9

I would like the data to shift as follows based on a number in a cell somewhere that I can change from time to time.

I would like to insert empty cells (2 columns) before cell C3 through C4 by selecting these cell in the Column C

This should shift the data in the desired cells to the right

Can someone help?
moz-screenshot-3.jpg
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

Forum statistics

Threads
1,216,101
Messages
6,128,845
Members
449,471
Latest member
lachbee

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