VBA to delete an entire row when a column matches a value

Mr_bikahs

New Member
Joined
Jan 14, 2011
Messages
41
Hello all,

Was wondering whether anyone could help me. Essentially I am trying to get something working that would look at column L in my spreadsheet, and if the value in a row for that column is equal to "Delete", it will delete the entire row in the spreadsheet.

Is there a formula I can use for this or will it require VBA?

Many thanks in advance
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Hello Marcelo,

Thanks for this. Been having a look at this. What I need though is that when a row is deleted, every row below needs to be moved up a row. I.e there should be no empty rows.

Don't think there is anything in those examples where the rows are moved up after a deletion. Is there a piece of code I can insert to do this?

Many thanks
 
Upvote 0
Hello Marcelo,

Thanks for this. Been having a look at this. What I need though is that when a row is deleted, every row below needs to be moved up a row. I.e there should be no empty rows.

Don't think there is anything in those examples where the rows are moved up after a deletion. Is there a piece of code I can insert to do this?

Many thanks

Hi,

Try one the codes in the Ron de Bruin's page and you'll see that everything works fine - no empty rows in the middle of your data are left.

Try it on a test-workbook

M.
 
Upvote 0

Forum statistics

Threads
1,224,506
Messages
6,179,159
Members
452,892
Latest member
yadavagiri

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