Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default how view a WS code/properties

I have defined some names on one of my WS's and need to make the same names
on some other sheets, how can I view my WB's names so that I can quickly
copy the names over to other WS's? everything in the definitions will be the
same bar the first letter.

Many thanks,

Steve


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default how view a WS code/properties

Steve,

Here is some starter code

Dim nme As Name
Dim sName As String
Dim sRefersTo As String

For Each nme In ActiveSheet.Names
sName = Mid(nme.Name, InStr(1, nme.Name, "!") + 1, 99)
sRefersTo = Mid(nme.RefersTo, InStr(1, nme.RefersTo, "!") + 1, 232)
Worksheets("Sheet3").Names.Add Name:=sName, RefersTo:="=Sheet3!" &
sRefersTo
Next nme

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Steven" wrote in message
...
I have defined some names on one of my WS's and need to make the same

names
on some other sheets, how can I view my WB's names so that I can quickly
copy the names over to other WS's? everything in the definitions will be

the
same bar the first letter.

Many thanks,

Steve




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default how view a WS code/properties

If you have defined the names at the workbook level, then they can not refer
to other sheets. You can have duplicate names if you make them worksheet
level

Dim nm as Name
for each nm in ActiveWorkbook
cells(rw,1).Value = nm.name
cells(rw,2).Value = nm.RefersTo
Next

--
Regards,
Tom Ogilvy

"Steven" wrote in message
...
I have defined some names on one of my WS's and need to make the same

names
on some other sheets, how can I view my WB's names so that I can quickly
copy the names over to other WS's? everything in the definitions will be

the
same bar the first letter.

Many thanks,

Steve




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default how view a WS code/properties

They will not be duplicates I will edit the first letter of them to be the
same as the WS they are for.

Steve

"Tom Ogilvy" wrote in message
...
If you have defined the names at the workbook level, then they can not

refer
to other sheets. You can have duplicate names if you make them worksheet
level

Dim nm as Name
for each nm in ActiveWorkbook
cells(rw,1).Value = nm.name
cells(rw,2).Value = nm.RefersTo
Next

--
Regards,
Tom Ogilvy

"Steven" wrote in message
...
I have defined some names on one of my WS's and need to make the same

names
on some other sheets, how can I view my WB's names so that I can quickly
copy the names over to other WS's? everything in the definitions will be

the
same bar the first letter.

Many thanks,

Steve






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default how view a WS code/properties

Thanks for the help, could explain what that coding does for me please?

My WS with the names i want to copy is called M, will this code copy all
names on WS M to all active WS's? changing the first letter of the names to
the name of the active WS's etc?

"Steven" wrote in message
...
I have defined some names on one of my WS's and need to make the same

names
on some other sheets, how can I view my WB's names so that I can quickly
copy the names over to other WS's? everything in the definitions will be

the
same bar the first letter.

Many thanks,

Steve






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default how view a WS code/properties

Steven,

No, but this should

Dim sh As Worksheet
Dim nme As Name
Dim sName As String
Dim sRefersTo As String

For Each sh In Activeworkbook.Worksheets
If sh.Name < "M" Then
For Each nme In sh.Names
sName = Mid(nme.Name, InStr(1, nme.Name, "!") + 2, 99)
sRefersTo = Mid(nme.RefersTo, InStr(1, nme.RefersTo, "!") +
1, 232)
Worksheets("Sheet3").Names.Add _
Name:=sh.Name & sName, _
RefersTo:="=Sheet3!" & sRefersTo
Next nme
End If
Next sh

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Steven" wrote in message
...
Thanks for the help, could explain what that coding does for me please?

My WS with the names i want to copy is called M, will this code copy all
names on WS M to all active WS's? changing the first letter of the names

to
the name of the active WS's etc?

"Steven" wrote in message
...
I have defined some names on one of my WS's and need to make the same

names
on some other sheets, how can I view my WB's names so that I can quickly
copy the names over to other WS's? everything in the definitions will be

the
same bar the first letter.

Many thanks,

Steve






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
Excel 2003 file/properties to view created date/time how in 2007? Bald Eagle Boy Excel Discussion (Misc queries) 2 June 27th 12 09:11 PM
Unable to see Properties in Design View for controls ts1 Excel Worksheet Functions 0 September 22nd 05 07:55 PM
MS Query, command View-Query Properties Frans van Zelm Excel Discussion (Misc queries) 0 January 6th 05 02:24 PM
File Properties Code John Michl[_2_] Excel Programming 4 August 28th 03 01:14 PM
Setting Font properties in Code clears Undo list Lorin Excel Programming 2 July 10th 03 09:49 PM


All times are GMT +1. The time now is 12:53 PM.

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

About Us

"It's about Microsoft Excel"