LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
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!

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Clear Contents Secret Squirrel Excel Discussion (Misc queries) 1 February 3rd 09 12:37 AM
Macro to clear range contents when cell contents are changed by us Steve E Excel Programming 12 February 22nd 07 09:09 PM
Clear contents SamanthaK Excel Programming 3 June 15th 06 09:05 AM
Clear Contents Help michael Excel Programming 3 June 6th 06 09:42 PM
Clear contents if x is not in the row Mighvik Excel Programming 1 October 5th 04 08:14 PM


All times are GMT +1. The time now is 07:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"