Need macro to auto delete selected cells

D

doc

OK, here's the deal. I work with a large spreadsheet that evaluates how
drilling crews do on each well. The sheets are set up with lots of
lines for data entry. Not all the lines get used and need to be
deleted. his is easly accomplished by selecting the range and
delete>shift cells up. However, some of the rig crews will delete the
rows, which removes some other data stored to the right. Is there a
macro that will delete a select range of cells if a particular cell is
empty? TIA.....Doc
 
P

Paul B

Doc, how about something like this

Sub Delete_Blank()
'Will delete the cells in A1:A50 that are blank
[A1:A50].SpecialCells(xlCellTypeBlanks).Delete Shift:=xlUp
End Sub

--
Paul B
Always backup your data before trying something new
Using Excel 2000 & 97
Please post any response to the newsgroups so others can benefit from it
** remove news from my email address to reply by email **
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top