Thread: clear contents
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Barb Reinhardt Barb Reinhardt is offline
external usenet poster
 
Posts: 3,355
Default clear contents

Try something like this

Sub ClearUntilEmpty()
Dim myRange As Range
Set myRange = Range("A4")

Do While Not IsEmpty(myRange)
myRange.ClearContents
Set myRange = myRange.Offset(0, 1)
Loop
End Sub


"Arne Hegefors" wrote:

hi! I have a named range consiting of only one cell. i want to clear the
contents of e cells starting at the named range until there are empty cells.
Example: my named range is a1. I want to clear a2,a3,a4 etc until i find a
cell that is empty. also i want to do the same with a2,b2,c2 until i find an
empty cell. also i want the field between the last cells eg a3 and c2 to be
cleared also (regardless of the contents). how can i do this? pls help!