Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Mike
 
Posts: n/a
Default Delete Define names across workbook

I have a workbook with about 35 or so tabs. What happened was that on the
first sheet, I named a cell "pe" and then copied that worsheet about 30
times or so. Each worksheet has a different set of data. The problem is
that each worksheet now has a cell named "pe". I only wanted the first
sheet to have a cell named "pe" since I have data being linked to it (cell
=pe, etc.) How can I remove the defined name on each worksheet without
having to manually do it? Maybe there is a macro or something.

Thanks
Mike


  #2   Report Post  
Boris Merryweather
 
Posts: n/a
Default

On the main menu press Insert, then select Name, then select Define. This
will give you a list of all defined names. Go through them and delete the
ones you don't want. This will be quicker than writing a macro of waiting for
a response from here.

Look on it as an education. It will remind you never to make the same
mistake again.

Pip pip

"Mike" wrote:

I have a workbook with about 35 or so tabs. What happened was that on the
first sheet, I named a cell "pe" and then copied that worsheet about 30
times or so. Each worksheet has a different set of data. The problem is
that each worksheet now has a cell named "pe". I only wanted the first
sheet to have a cell named "pe" since I have data being linked to it (cell
=pe, etc.) How can I remove the defined name on each worksheet without
having to manually do it? Maybe there is a macro or something.

Thanks
Mike



  #3   Report Post  
Duke Carey
 
Posts: n/a
Default

create a new module in your workbook and paste in this code. be sure to
change the line that excludes Sheet1 so that it references the name of the
sheet where you want to KEEP the name

Option Explicit

Sub DeletePE()
Dim ws As Worksheet
Dim rng As Range

For Each ws In ThisWorkbook.Worksheets
' change Sheet1 in the next line to the name
' of the sheet where you WANT the range name
If ws.Name < "Sheet1" Then
On Error Resume Next
Set rng = ws.Range("pe")
If Err.Number = 0 Then
ws.Names("pe").Delete
End If
End If
Next
End Sub

"Mike" wrote:

I have a workbook with about 35 or so tabs. What happened was that on the
first sheet, I named a cell "pe" and then copied that worsheet about 30
times or so. Each worksheet has a different set of data. The problem is
that each worksheet now has a cell named "pe". I only wanted the first
sheet to have a cell named "pe" since I have data being linked to it (cell
=pe, etc.) How can I remove the defined name on each worksheet without
having to manually do it? Maybe there is a macro or something.

Thanks
Mike



  #4   Report Post  
Dave Peterson
 
Posts: n/a
Default

If you work with names, do yourself a favor and get a copy of Jan Karel
Pieterse's (with Charles Williams and Matthew Henson) Name Manager:

You can find it at:
NameManager.Zip from http://www.oaltd.co.uk/mvp

Mike wrote:

I have a workbook with about 35 or so tabs. What happened was that on the
first sheet, I named a cell "pe" and then copied that worsheet about 30
times or so. Each worksheet has a different set of data. The problem is
that each worksheet now has a cell named "pe". I only wanted the first
sheet to have a cell named "pe" since I have data being linked to it (cell
=pe, etc.) How can I remove the defined name on each worksheet without
having to manually do it? Maybe there is a macro or something.

Thanks
Mike


--

Dave Peterson
  #5   Report Post  
Mike
 
Posts: n/a
Default

Duke,
Your solution worked perferctly. Thank you. Boris, when I go to insert and
defined names, it only lists the pe on whatever sheet I am at, not all the
pe(s) for all the worksheets.

Thanks Everybody

Mike




"Dave Peterson" wrote in message
...
If you work with names, do yourself a favor and get a copy of Jan Karel
Pieterse's (with Charles Williams and Matthew Henson) Name Manager:

You can find it at:
NameManager.Zip from http://www.oaltd.co.uk/mvp

Mike wrote:

I have a workbook with about 35 or so tabs. What happened was that on the
first sheet, I named a cell "pe" and then copied that worsheet about 30
times or so. Each worksheet has a different set of data. The problem is
that each worksheet now has a cell named "pe". I only wanted the first
sheet to have a cell named "pe" since I have data being linked to it
(cell
=pe, etc.) How can I remove the defined name on each worksheet without
having to manually do it? Maybe there is a macro or something.

Thanks
Mike


--

Dave Peterson



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
HOW DO I SUM TWO CELLS FROM ONE WORKBOOK TO ANOTHER WORKBOOK? Bill O'Neal Excel Worksheet Functions 8 August 14th 09 11:36 PM
copying cell names Al Excel Discussion (Misc queries) 12 August 11th 05 03:01 PM
alternate UI for Define Names ?? jmg092548 Excel Discussion (Misc queries) 2 August 11th 05 01:32 PM
How can I Copy cell names from one workbook to another? G.H.B.B. Excel Discussion (Misc queries) 1 March 24th 05 02:30 AM
Unprotect Workbook Kent Excel Discussion (Misc queries) 1 February 4th 05 01:07 AM


All times are GMT +1. The time now is 01:16 AM.

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"