Hide Defined Names

D

Desert Piranha

Hi all,

While this code works fine for creating & hiding one defined name.
How can i change it to hide ALL defined names in the workbook,
if there are 20/30 of them, that already exist.

Public Sub Tester03()
'From Norman Jones
With ActiveWorkbook
.Names.Add "MyTestRange", _
RefersTo:=.Sheets("Sheet1").Range("A4:B10"), _
Visible:=False
End With
End Sub

Something like:

Public Sub Tester03()
With ActiveWorkbook
.Names.Visible:=False
End With
End Su
 
G

Gary Keramidas

try this

Option Explicit
Dim nm As name
Sub hide_names()
For Each nm In ThisWorkbook.Names
nm.Visible = False
Next nm
End Sub



--


Gary


"Desert Piranha"
 
N

Norman Jones

Hi Dave,

You have a response to your question, but for any serious work with names, I
would advise you to download Jan Karel Pieterse's invaluable Name Manager
addin.

It is downloadable, free of charge, at:

http://www.jkp-ads.com/Download.htm

---
Regards,
Norman



"Desert Piranha"
 
D

Desert Piranha

Hi Gary,
Thx, this works fine. Exactly what i was looking for.
thx Again

Hi Norman,
I do have that add-in you mentioned. I wanted a code i could run to
hide/unhide names,
as not all the computers i work on, have the add-in. Hence if i hide
them at home, then
take the file to work i may need to unhide them.
I can run this from the VBE, without anyone knowing its there.

Thx for your input.

Dave

Gary said:
try this

Option Explicit
Dim nm As name
Sub hide_names()
For Each nm In ThisWorkbook.Names
nm.Visible = False
Next nm
End Sub



--


Gary


"Desert Piranha"
message
 

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