VBA: deleting rows returned blank by a function

MaryBrenna

New Member
Joined
Aug 8, 2012
Messages
4
Hello everyone,

is there any possible way to set up a macro that will delete rows that were returned as blank from a function? I am putting together a book database and I want to have separate sheets for languages, genres etc. I decided to create a "General" sheet for all the info and then use links so that I only need to put the new information once.

To show only the selected books on a sheet, I used the if function as follows, so the name of the book only appears if it's in English. (And I have used this one for columns A-F to display all the info about the book as well.)
=IF(General!$D2="English";General!A2;"")

Now how could I automatically delete the rows which are returned blank by this function? I have tried a macro for deleting blank rows, but since these are not truly empty, it did not work. Or should I put the if function in a different way first?

Thank you all for your answers

Using Excel 2010 on Win7
 
Sure it did, it's just that so far I haven't got that much data in the workbook as to notice the speed difference. You know, I wanted to make it work first. So I actually tried all the options you guys gave me. But thank you for pointing that out, I'm sure the list is going to be a long one :biggrin:
 
Upvote 0

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

Forum statistics

Threads
1,221,310
Messages
6,159,173
Members
451,543
Latest member
cesymcox

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