Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Dave T at home
 
Posts: n/a
Default Define Names in Excel

Insert - I have a workbook for each month of the year. I have named cells
in the workbook e.g. DT_Inc_Jan_Pupil_Hourly_Cash and DT_Exp_Jan_Fuel_Cash.

I have pasted the names into a workbook.

I would like to copy these NAMES and do a replace from '_Jan_' to '_FEB_'
etc as I need an entry for each month and then Define them in Names.

Can this be done easily without adding each entry in Insert - Name -
Define or can someone help me please with an easier / better method?

Thanks

Dave
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default Define Names in Excel

Dave,

VBA OK?

Sub UpdateNames()
Dim nme As Name

For Each nme In ActiveWorkbook.Names
If nme.Name Like "*Jan*" Then
Names.Add Name:=Replace(nme.Name, "Jan", "Feb"),
RefersTo:=nme.RefersTo
nme.Delete
End If
Next nme
End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Dave T at home" <Dave T at wrote in message
...
Insert - I have a workbook for each month of the year. I have named

cells
in the workbook e.g. DT_Inc_Jan_Pupil_Hourly_Cash and

DT_Exp_Jan_Fuel_Cash.

I have pasted the names into a workbook.

I would like to copy these NAMES and do a replace from '_Jan_' to '_FEB_'
etc as I need an entry for each month and then Define them in Names.

Can this be done easily without adding each entry in Insert - Name -
Define or can someone help me please with an easier / better method?

Thanks

Dave



  #3   Report Post  
Dave T at home
 
Posts: n/a
Default Define Names in Excel

Thanks for youur help Bob.

I have also found NamesManager created by Jan Karel Pieterse and others
which does everything (and more) that I wanted at
http://www.decisionmodels.com/downloads.htm

I have now used it for a couple of days and found it very helpful as I now
have 788 names in my excel file.

Thanks again for your help.

Dave
"Bob Phillips" wrote:

Dave,

VBA OK?

Sub UpdateNames()
Dim nme As Name

For Each nme In ActiveWorkbook.Names
If nme.Name Like "*Jan*" Then
Names.Add Name:=Replace(nme.Name, "Jan", "Feb"),
RefersTo:=nme.RefersTo
nme.Delete
End If
Next nme
End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Dave T at home" <Dave T at wrote in message
...
Insert - I have a workbook for each month of the year. I have named

cells
in the workbook e.g. DT_Inc_Jan_Pupil_Hourly_Cash and

DT_Exp_Jan_Fuel_Cash.

I have pasted the names into a workbook.

I would like to copy these NAMES and do a replace from '_Jan_' to '_FEB_'
etc as I need an entry for each month and then Define them in Names.

Can this be done easily without adding each entry in Insert - Name -
Define or can someone help me please with an easier / better method?

Thanks

Dave




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 FAILS, but Excel 2000 SUCCEEDS ??? Richard Excel Discussion (Misc queries) 2 May 13th 23 11:46 AM
some kind of meta-way to refer to sheet and file names in Excel? GoBobbyGo Excel Discussion (Misc queries) 7 February 22nd 06 03:05 PM
Can I insert a file or folder names in Excel cells? Inserting file or folder names in cells. Excel Discussion (Misc queries) 1 October 6th 05 11:30 PM
Import data from files with different names to EXCEL D'base. thunderfoot Excel Discussion (Misc queries) 2 June 10th 05 11:05 AM
How do you define variables in excel? BigRon Excel Discussion (Misc queries) 6 April 16th 05 08:47 PM


All times are GMT +1. The time now is 05:18 PM.

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"