View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Zak Zak is offline
external usenet poster
 
Posts: 144
Default Clearing contents

Thanks guys its worked a treat, appreciate the prompt reply.

"Per Jessen" wrote:

Hi

Look at this:

Sub ClearRow()
Dim TargetRange As Range
Set TargetRange = Range("E2", Range("E65536").End(xlUp))

For Each c In TargetRange
If c.Value < "" Then c.EntireRow.ClearContents
Next
End Sub

Regards,
Per

"Zak" skrev i meddelelsen
...
Hi,

Hope u can help me..

I would like to know how i can tell a macro to clear contents when:

If a cell in column E is NOT blank then clear the contents of that entire
row (but NOT delete the row), and i want to start looking for non blanks
after the header row to avoid the hearder getting cleared.

thanks for your help.