Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Clear Contents | Excel Discussion (Misc queries) | |||
Macro to clear range contents when cell contents are changed by us | Excel Programming | |||
Clear contents | Excel Programming | |||
Clear Contents Help | Excel Programming | |||
Clear contents if x is not in the row | Excel Programming |