Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
There is no guarantee that ReferstoRange will be defined for all names. If
you don't account for that, you can get an error. Of course in this user's case, that may not be an issue. -- Regards, Tom Ogilvy "Dana DeLouis" wrote in message ... Here's just another general idea... Sub Demo() Dim nme As Name Const ClearNamesOnThisSheet As String = "Sheet1" For Each nme In ActiveWorkbook.Names If StrComp( _ nme.RefersToRange.Parent.Name, _ ClearNamesOnThisSheet, _ vbTextCompare) = 0 Then Range(nme).ClearContents End If Next nme End Sub -- Dana DeLouis Using Windows XP & Office XP = = = = = = = = = = = = = = = = = "Ian" wrote in message ... I has a worksheet with approx 20 separate named ranges. I wish to clear the contents of all these ranges through VBA in the most efficient way. Is there a way of selecting all the named ranges within a specifc worksheet so that I can apply ClearContents to all the ranges at once. Thanks. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Index and named ranges selecting difficulty | Excel Worksheet Functions | |||
Selecting Multiple Columns in a Named Selection | Excel Worksheet Functions | |||
Like 123, allow named ranges, and print named ranges | Excel Discussion (Misc queries) | |||
Selecting Filtered Items from Named range | Excel Programming | |||
selecting ranges | Excel Programming |