define names

ehsas

Board Regular
Joined
Sep 17, 2002
Messages
200
I have more than 20 columns in my excel file which i need to define as name.Currently I have to select each column manually and then define as name.Is there any way where column heading be selected as defaulted name.Regards,
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
If the columns you want to name are consecutive, you can use this macro.
First: type in A1, B1, C1,...etc. the names, then run the macro:

Sub Macro1()
x = 1
Do While Cells(1, x)<> ""
ActiveWorkbook.Names.Add Name:=Cells(1, x), RefersToR1C1:="=Sheet1!R2C" & x & ":R100C" & x
x = x + 1
Loop
End Sub

Note: If the first cell used by the macro (in my example A1) is blank, the macro doesn't work.
This message was edited by albert 1 on 2002-10-12 08:31
 
Upvote 0
On 2002-10-12 05:38, ehsas wrote:
I have more than 20 columns in my excel file which i need to define as name.Currently I have to select each column manually and then define as name.Is there any way where column heading be selected as defaulted name.Regards,

Are these columns contiguous?

Do they change (expand/crimp) in concert?

Which column is of numeric type?

These questions are meant to assess whether you can define one (or two) names that refer to data in these columns.
 
Upvote 0
Are these columns contiguous? no

Do they change (expand/crimp) in concert? no

Which column is of numeric type? no numeric all are text
 
Upvote 0
On 2002-10-12 07:20, ehsas wrote:
Are these columns contiguous? no

Do they change (expand/crimp) in concert? no

Which column is of numeric type? no numeric all are text

If the columns ranges are of equal size and the date they hold are related, you still can define a single name for the whole bunch. The INDEX function can then be used to access the individual columns. Maybe this isn't worth the effort...
 
Upvote 0
I have done another way I have selected all the columns where i need to define as name and choosed insert-name-create and select the top row and it created the names for the column.Please advise if it is correct way of doing.

Regards,
 
Upvote 0
On 2002-10-12 10:40, ehsas wrote:
I have done another way I have selected all the columns where i need to define as name and choosed insert-name-create and select the top row and it created the names for the column.Please advise if it is correct way of doing.

Regards,

That's OK. You can check each name from the Name Box to see whether it references the appropriate range.
 
Upvote 0

Forum statistics

Threads
1,214,830
Messages
6,121,831
Members
449,051
Latest member
excelquestion515

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