Thread: Deleting Rows
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Deleting Rows

Dim rng as Range
on error resume next
set rng = columns(1).specialcells(xlblanks)
On error goto 0
if not rng is nothing then
if rng.Row = 1 then
rng.Areas(1).EntireRow.Delete
end if
end if

--
Regards,
Tom Ogilvy


"STEVEB" wrote in
message ...

Hi,

I have a sheet that has blank rows at the beginning of the spreadsheet.
For example this week rows 1 thru 3 are empty before data is entered in
Row 4. Last week rows 1 thru 8 were empty and sometimes there are no
empty rows before data is entered (Data in row 1).

Since the number of empty rows varies each month, is there a way to
delete the entire empty row(s), if any, before data is entered in
column A.

Any help would be greatly appreciated!


--
STEVEB
------------------------------------------------------------------------
STEVEB's Profile:

http://www.excelforum.com/member.php...fo&userid=1872
View this thread: http://www.excelforum.com/showthread...hreadid=483143