Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10
Default name cells with their adjuscent cells

How can I do a batch naming of a series of cells by the cells next to them.

e.g.

A1 = apple B1=10
A2= orange B2=12
A3= banana B3=5

I want to name B1 to apple, B2 to Orange and B3 to banana.

At the moment, I enter them manually. Are there any better way?

Thanks in advance.


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,388
Default name cells with their adjuscent cells

Hi LC,
Try this small macro.
It will name cells in Column B according to info in Column A.
It will stop when it finds a blank cell in Cloumn A

Sub NameB()
Dim A As Integer
A = 1
Do Until Cells(A, 1) = ""
ActiveWorkbook.Names.Add Name:=Cells(A, 1), RefersToR1C1:=Cells(A, 2)
A = A + 1
Loop
End Sub

Regards - Dave.
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default name cells with their adjuscent cells

simple macro
Sub namecells()
For i = 1 To 3
Cells(i, "b").Name = Cells(i, "a")
Next
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Lamb Chop" wrote in message
...
How can I do a batch naming of a series of cells by the cells next to
them.

e.g.

A1 = apple B1=10
A2= orange B2=12
A3= banana B3=5

I want to name B1 to apple, B2 to Orange and B3 to banana.

At the moment, I enter them manually. Are there any better way?

Thanks in advance.



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default name cells with their adjuscent cells

One mo
Select A1:B3
Insert|Name|Create
Check Left Column and uncheck all the others.
Click ok.

Lamb Chop wrote:

How can I do a batch naming of a series of cells by the cells next to them.

e.g.

A1 = apple B1=10
A2= orange B2=12
A3= banana B3=5

I want to name B1 to apple, B2 to Orange and B3 to banana.

At the moment, I enter them manually. Are there any better way?

Thanks in advance.



--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,388
Default name cells with their adjuscent cells

Hi DP,
Thanks for pointing that out. Didn't know that was an option. Much simpler
and tidier than a macro.
Regards - Dave.


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default name cells with their adjuscent cells

I've never used it in real life. I don't remember it's there until the macro
has finished <vbg.

Dave wrote:

Hi DP,
Thanks for pointing that out. Didn't know that was an option. Much simpler
and tidier than a macro.
Regards - Dave.


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default name cells with their adjuscent cells

I've used the create names a few times to build a mileage matrix or similar.

city1, city2 etc. across the top and city_1, city_2 etc. down the side

Then =city4 city_12 retrieves the intersecting value.


Gord


On Fri, 18 Jul 2008 16:59:28 -0500, Dave Peterson
wrote:

I've never used it in real life. I don't remember it's there until the macro
has finished <vbg.

Dave wrote:

Hi DP,
Thanks for pointing that out. Didn't know that was an option. Much simpler
and tidier than a macro.
Regards - Dave.


  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default name cells with their adjuscent cells

This depends on the Tools|Options|Calculation tab|Accept labels in formulas
setting.

Since it was removed in xl2007, I guess MS didn't realize that you were one of
the few people who used this <vbg.



Gord Dibben wrote:

I've used the create names a few times to build a mileage matrix or similar.

city1, city2 etc. across the top and city_1, city_2 etc. down the side

Then =city4 city_12 retrieves the intersecting value.

Gord

On Fri, 18 Jul 2008 16:59:28 -0500, Dave Peterson
wrote:

I've never used it in real life. I don't remember it's there until the macro
has finished <vbg.

Dave wrote:

Hi DP,
Thanks for pointing that out. Didn't know that was an option. Much simpler
and tidier than a macro.
Regards - Dave.


--

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
Excel: match two cells in one sheet to two cells in another and return a third cells value Spence Excel Worksheet Functions 3 February 13th 11 05:33 AM
Cells won't change font color or show hi-lighted cells in document ROBIN Excel Discussion (Misc queries) 1 March 27th 08 09:39 PM
display a range of cells editible cells based on matching date Miki Excel Worksheet Functions 0 October 10th 07 03:27 PM
Setting of input cells as blue font and formula cells as black fon Sunnyskies Excel Discussion (Misc queries) 2 May 14th 07 05:27 PM
trying to create an (almost) circular formula between cells and data validated cells with lists KR Excel Worksheet Functions 0 May 12th 05 07:21 PM


All times are GMT +1. The time now is 03:45 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"