#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Cell Naming

Ok, I have a problem. I have to name a large number of cells in
different sheets. I'm hoping that there is a way in a macro, or some
other way to define these in an easier way other than one by one. Here
is an example:

1 2 3 4
1001 --------- --------- --------- ---------
1002 --------- --------- --------- ---------
1209 --------- --------- --------- ---------
1210 --------- --------- --------- ---------


This would be the column and row headers for the cells. Below is how
the cells would have to be named:


1 2 3 4
1001 S_1001_01 S_1001_02 S_1001_03 S_1001_04
1002 S_1002_01 S_1002_02 S_1002_03 S_1002_04
1209 S_1209_01 S_1209_02 S_1209_03 S_1209_04
1210 S_1210_01 S_1210_02 S_1210_03 S_1210_04


There are thousands of cells I have to name in a similar fashion. Is
there a shortcut way to define these cells through a macro? Thanks in
advance for any help any of you may pass my way.

-Dan Canham



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 695
Default Cell Naming

Some like this:

Sub MultiName()

Dim r As Long
For r = 1001 To 2000
Cells(r, 1).Name = "S_" & r & "_01"
Cells(r, 2).Name = "S_" & r & "_02"
Cells(r, 3).Name = "S_" & r & "_03"
Cells(r, 4).Name = "S_" & r & "_04"
Next

End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Cell Naming

excelent wrote:
Some like this:

Sub MultiName()

Dim r As Long
For r = 1001 To 2000
Cells(r, 1).Name = "S_" & r & "_01"
Cells(r, 2).Name = "S_" & r & "_02"
Cells(r, 3).Name = "S_" & r & "_03"
Cells(r, 4).Name = "S_" & r & "_04"
Next

End Sub

Thanks for the help
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
Naming a Cell Zachary Kinning Excel Discussion (Misc queries) 5 February 24th 09 09:54 PM
Naming a cell from VB Brettjg Excel Discussion (Misc queries) 3 August 26th 08 09:58 AM
Cell and tab naming bpoland58 Excel Discussion (Misc queries) 1 December 13th 07 06:27 PM
tab naming from a set cell duckie Excel Discussion (Misc queries) 1 October 3rd 07 09:57 AM
Naming a cell mike Excel Worksheet Functions 2 January 12th 05 11:31 PM


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