how does excel decide a suggested name to a range?

S

STEVE BELL

It would help if you included a copy of the code or replied from the
previous message so that we could more easily see what you are working with.

Now we need to know what you mean by "stopped working" ???
If there are no names on the ActiveSheet than it "will stop working".

Are you getting any Error codes?

Please help us help you by sending as much info as possible...

Here is a copy of the code you previously posted with an added line to Dim
RName. Excel
needs this to define the variable.

Sub CleanDown()

Dim RName As Name

For Each RName In ActiveSheet.Names
RName.Delete
Next RName

End Sub
 
I

iainshaw

Ok, thanks again Steve

but I can no longer get this to work. By that I mean if I try to ru
it in a sheet where there are c. 15 range names defined it does no
appear to do anything. I have another routine that cycles through th
sheet naming dynamic ranges pulled out of a dB. What I'd like to b
able to do is to clean down the rangenames whenever I add to the dB.

So - the code in the Workbook is as follows:

Sub CleanDown()

Dim RName As Name

For Each RName In ActiveSheet.Names
RName.Delete
Next RName

End Sub

I can run the code in the workbook and the c.15 Range Names that ar
there remain unaffected. Is there any other information I need t
provide to debug this. As I say it worked fine yesterday. It doesn'
work today even though I have added your Dim statement to it. The cod
looks fine to me

There are no error messages generate
 
S

STEVE BELL

If you would like - send it to my email and I'll have a look...

(e-mail address removed)
 
I

iainshaw

Steve,
my mail has bounced...could you PM me and I'll reply to a differen
account
thank
 
S

STEVE BELL

Try these addresses:

(e-mail address removed)

(e-mail address removed)

and give my your email and I'll send something to you so we can get this
started...
 
I

iainshaw

Hi steve, I've sent the Excel file with the reluctant macro to you
hotmail account
thank
 
I

iainshaw

Steve, I can't reply to your verizon account - just bounces.

Just wanted to say a big thank you - the code is a really elegant
solution and it works well. thank you
Iain
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top