View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Delete rows foward if cell is empty

It was a last minute change to be a bit more robust since I don't have any
knowledge of your sheet. I left off a closing parenthesis. Len checks the
length of the entry in the cell. this should work even if it looks blank.



Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On error goto errhandler
if len(trim(Range("A1").Value)) = 0 then
Application.EnableEvents = False
rows.delete
end if
ErrHandler:
Application.EnableEvents = True
End Sub


--
Regards,
Tom Ogilvy

"Metrazal" wrote in
message ...

I get a compile error with this code on the if statement. What is len?
Length? I don't know.. Anyway, I could not get this code to work.

Any help?

Thanks,

Met


--
Metrazal
------------------------------------------------------------------------
Metrazal's Profile:

http://www.excelforum.com/member.php...o&userid=31648
View this thread: http://www.excelforum.com/showthread...hreadid=516182