Annoying delete empty rows question

  • Thread starter Thread starter Tamsen
  • Start date Start date
T

Tamsen

Hi there - please forgive the newbie question, I've been searching
around on these boards for an answer and nothing seems to quite fit.

Scenario:-
I have a worksheet template (although not an .xlt file) that multiple
people will be using as a basis to add their own data into. (i.e. the
amount of data varies per workbook).

I want to make sure that people don't leave blank rows (based on at
least 2 columns of info).

So - I have been going down the autofilter route, and I get to the
point where I have all the blank rows based on 2 columns displayed
fine.

My question is - how can I automate the selection of a variable amount
of blank rows to delete them?

Ideally I would love a VBA solution, as I'll have approx 18
spreadsheets to complete this on at least 2 or 3 times a week...
URGH!
 
SpecialCells works fine if I am selecting rows to delete based on a
criteria of a blank cell in 1 column, as soon as I try to make this
judgement based on 2 columns it does not work.

Data format is such

Row 1 Column A Column B Column C
Row 2 data data
Row 3 data data
Row 4
Row 5 data data data
Row 6 data data

So I'm doing an auto filter on Column A and Column B to look for
blanks in the 2 columns ONLY - and then figure out how to select those
rows. In the example above, I want it to delete Row 4 only.

OR - I use the SpecialCells suggestion below:-
Columns("A:B").Activate
Cells.SpecialCells(xlCellTypeBlanks).EntireRow.Delete - this is the
line that does not work. I get a run time error "'1004' - cannot use
that command on overlapping sections'.

If I change the above to say just Columns("A:A") or ("B:B") it does
delete based on that criteria, but doesn't work for my purposes (it
deletes row 4 and row 3, or row 4 and row 6.)

Still a newbie, and still need some guidance :(

Many thanks in advance
 
I feel better now. (I thought humor, but then I thought of all the special
things my special version of excel does! <vbg>)

Tom said:
It was a joke <g>

But yes, I hope they both end up with the same result.
 
Back
Top