Change Multiple Defined Names

Veeatch

New Member
Joined
Aug 27, 2023
Messages
1
Office Version
  1. 2019
Platform
  1. Windows
Hi Guys,
I have a heap of Defined names, a few hundred actually that I want to change how they are currently named,
I have done all of these manually over a long period of time, and now I want to clean things up so it is easier to find what I need.
i was hoping there was a quick way to change these (VBA code perhaps) names so that the number (xx.xx) comes first, as they are currently last as outlined below.

xx.xx is currently from 01.01 to 80.09, so that's a lot to change manually.
any help with this would be awesome.

BOQ_Title_xx.xx
BOQ_SQM_xx.xx
BOQ_SQMRate_xx.xx
BOQ_PCTotal_xx.xx
BOQ_PSTotal_xx.xx
BOQ_Markup_xx.xx
BOQ_ScopeSQM_xx.xx
BOQ_ScopeTrue_xx.xx
BOQ_CTotal_xx.xx
BOQ_Profit_xx.xx
BOQ_STotal_xx.xx
BOQ_GST_xx.xx
BOQ_GTotal_xx.xx
BOQ_Scope_xx.xx

they should look like this, so I can quickly find a section by number.
xx.xx_BOQ_Title
xx.xx_BOQ_SQM
xx.xx_BOQ_SQMRate
xx.xx_BOQ_PCTotal
xx.xx_BOQ_PSTotal
xx.xx_BOQ_Markup
xx.xx_BOQ_ScopeSQM
xx.xx_BOQ_ScopeTrue
xx.xx_BOQ_CTotal
xx.xx_BOQ_Profit
xx.xx_BOQ_STotal
xx.xx_BOQ_GST
xx.xx_BOQ_GTotal
xx.xx_BOQ_Scope

thanks guys.
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
What do you mean by "find a section by number"? You can easily extract the number portion of the name:
mid("BOQ_Scope_xx.xx",Instrrev("BOQ_Scope_xx.xx","_")+1) which returns xx.xx

I think transposing the numeric portion will be tricky, although probably doable, but maybe you don't have to? I think it depends on whether you have a list of Defined Names or not (or could make one with a debug.print list). If not and you intend to loop over all the Defined Names, when using vba they can look like
Sheet8!Criteria, or
EditableRange
so that may be an issue.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,335
Messages
6,124,327
Members
449,155
Latest member
ravioli44

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top