Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
al al is offline
external usenet poster
 
Posts: 363
Default Editing large numbers of cell names

I have 100s of cell names withing my spreadsheet. Is there a more efficient
way of editing these rather than one at a time (Insert - Name - Define)

Office Professional 2003.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Editing large numbers of cell names

What happened to your previous post...

Use the below macro to rename all the named ranges at one shot...The below
macro would get the sheet name for each named range and if it is SHEET1 then
add a "_A" to the current name "_B" if the range is referred to Sheet2 and so
on..

--Edit the sheetnames to suit your requirement
--Note that the sheetnames are in upper case

If you are new to macros..

--Set the Security level to low/medium in (Tools|Macro|Security).
--From workbook launch VBE using short-key Alt+F11.
--From menu 'Insert' a module and paste the below code.
--Get back to Workbook.
--Run macro from Tools|Macro|Run <selected macro()


Sub Macro()
Dim varName As Name
For Each varName In ActiveWorkbook.Names
Select Case UCase(Mid(Split(varName.RefersTo, "!")(0), 2))
Case "SHEET1"
varName.Name = varName.Name & "_A"
Case "SHEET2"
varName.Name = varName.Name & "_B"
Case "SHEET5"
varName.Name = varName.Name & "_C"
End Select
Next
End Sub


If this post helps click Yes
---------------
Jacob Skaria


"Al" wrote:

I have 100s of cell names withing my spreadsheet. Is there a more efficient
way of editing these rather than one at a time (Insert - Name - Define)

Office Professional 2003.

  #3   Report Post  
Posted to microsoft.public.excel.misc
al al is offline
external usenet poster
 
Posts: 363
Default Editing large numbers of cell names

Yes, I am new to macros, so I will experiment as per your suggestion...thank
you very much!

What did you mean by "What happened to your previous post.....?"



"Jacob Skaria" wrote:

What happened to your previous post...

Use the below macro to rename all the named ranges at one shot...The below
macro would get the sheet name for each named range and if it is SHEET1 then
add a "_A" to the current name "_B" if the range is referred to Sheet2 and so
on..

--Edit the sheetnames to suit your requirement
--Note that the sheetnames are in upper case

If you are new to macros..

--Set the Security level to low/medium in (Tools|Macro|Security).
--From workbook launch VBE using short-key Alt+F11.
--From menu 'Insert' a module and paste the below code.
--Get back to Workbook.
--Run macro from Tools|Macro|Run <selected macro()


Sub Macro()
Dim varName As Name
For Each varName In ActiveWorkbook.Names
Select Case UCase(Mid(Split(varName.RefersTo, "!")(0), 2))
Case "SHEET1"
varName.Name = varName.Name & "_A"
Case "SHEET2"
varName.Name = varName.Name & "_B"
Case "SHEET5"
varName.Name = varName.Name & "_C"
End Select
Next
End Sub


If this post helps click Yes
---------------
Jacob Skaria


"Al" wrote:

I have 100s of cell names withing my spreadsheet. Is there a more efficient
way of editing these rather than one at a time (Insert - Name - Define)

Office Professional 2003.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Editing large numbers of cell names

You posted the same question yesterday and I responded

If this post helps click Yes
---------------
Jacob Skaria


"Al" wrote:

Yes, I am new to macros, so I will experiment as per your suggestion...thank
you very much!

What did you mean by "What happened to your previous post.....?"



"Jacob Skaria" wrote:

What happened to your previous post...

Use the below macro to rename all the named ranges at one shot...The below
macro would get the sheet name for each named range and if it is SHEET1 then
add a "_A" to the current name "_B" if the range is referred to Sheet2 and so
on..

--Edit the sheetnames to suit your requirement
--Note that the sheetnames are in upper case

If you are new to macros..

--Set the Security level to low/medium in (Tools|Macro|Security).
--From workbook launch VBE using short-key Alt+F11.
--From menu 'Insert' a module and paste the below code.
--Get back to Workbook.
--Run macro from Tools|Macro|Run <selected macro()


Sub Macro()
Dim varName As Name
For Each varName In ActiveWorkbook.Names
Select Case UCase(Mid(Split(varName.RefersTo, "!")(0), 2))
Case "SHEET1"
varName.Name = varName.Name & "_A"
Case "SHEET2"
varName.Name = varName.Name & "_B"
Case "SHEET5"
varName.Name = varName.Name & "_C"
End Select
Next
End Sub


If this post helps click Yes
---------------
Jacob Skaria


"Al" wrote:

I have 100s of cell names withing my spreadsheet. Is there a more efficient
way of editing these rather than one at a time (Insert - Name - Define)

Office Professional 2003.

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
Editing cell names Al Excel Discussion (Misc queries) 1 November 9th 09 06:20 AM
Editing a list of names that have numbers- Can i take out the numb WalMatt23 Excel Worksheet Functions 7 August 13th 08 07:23 PM
Cell with numbers and names, need to devide them Lion2004 Excel Discussion (Misc queries) 2 December 5th 07 12:46 PM
Editing out numbers in a cell Aversin Excel Discussion (Misc queries) 5 April 13th 06 09:29 PM
error message when editing a large spreadsheet Quantech Industrial Excel Worksheet Functions 0 June 9th 05 09:50 AM


All times are GMT +1. The time now is 11:21 AM.

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"