VBA to insert row based on criteria

Spartan300

Board Regular
Joined
Jul 1, 2008
Messages
71
Hi,

I have a sheet of around 5000 rows, I would like a macro to do some manual work for me.

Is it possible for a macro to insert a row if a "1" is present in column I. If possible I would like the row to be inserted above the 1.

Thanks
 
Hi All,


how to insert a row above different content in the column use the formula unequal and interval validations as follow;


Example;
A B C
ID2 3 6
ID2 7 8
ID4 0 2
ID5 2 3
ID5 4 6
ID5 6 8
ID7 1 3
ID8 0 2
ID8 2 3






Result;
A B C
ID From To


ID2 0 3 (row inserted, interval validated)
ID2 3 6
ID2 6 7 (row inserted, interval validated)
ID2 7 8
ID4 0 2
ID5 0 2 (row inserted, interval validated)
ID5 2 3
ID5 3 4 (row inserted, interval validated)
ID5 4 6
ID5 6 8
ID7 0 1 (row inserted, interval validated)
ID7 1 3
ID8 0 2
ID8 2 3




I greatly appreciate your help. Thank you
 
Upvote 0

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

Forum statistics

Threads
1,216,077
Messages
6,128,685
Members
449,463
Latest member
Jojomen56

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