Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 396
Default Clear Named Ranges

Hi All, I have a number of named ranges on a spread sheet and need to
clear their values on exiting the spread sheet. Is it possible to "Clear
all" ??

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Clear Named Ranges

Sub clearum()
Dim n As Name
For Each n In ActiveWorkbook.Names
Range(n).Clear
Next
End Sub


Note that the Name is really a string and therefore appears in the RANGE()
argument
--
Gary''s Student
gsnu200709


"Les Stout" wrote:

Hi All, I have a number of named ranges on a spread sheet and need to
clear their values on exiting the spread sheet. Is it possible to "Clear
all" ??

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Clear Named Ranges

Via a loop.

Dim nme As Name

For Each nme In ThisWorkbook.Names
If Not nme.Name Like "*_FilterDatabase" And _
Not nme.Name Like "*Print_Area" And _
Not nme.Name Like "*Print_Titles" And _
Not nme.Name Like "*wvu.*" And _
Not nme.Name Like "*wrn.*" And _
Not nme.Name Like "*!Criteria" Then
nme.Delete
End If
Next nme


--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Les Stout" wrote in message
...
Hi All, I have a number of named ranges on a spread sheet and need to
clear their values on exiting the spread sheet. Is it possible to "Clear
all" ??

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 396
Default Clear Named Ranges

Thanks very much for the input and code Gary's Student, much
appreciated... (I'm getting there):)

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***
Reply
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
union of named ranges based only on the names of those ranges sloth Excel Programming 3 October 2nd 06 03:18 AM
Copy data in named ranges to a newer version of the same template to identical ranges handstand Excel Programming 0 August 21st 06 03:51 PM
VBA Macro to Clear Named Cell Contents [email protected] Excel Programming 3 January 3rd 06 08:42 PM
Like 123, allow named ranges, and print named ranges WP Excel Discussion (Misc queries) 1 April 8th 05 06:07 PM
named ranges - changing ranges with month selected gr8guy Excel Programming 2 May 28th 04 04:50 AM


All times are GMT +1. The time now is 09:28 PM.

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

About Us

"It's about Microsoft Excel"