Can I Assign a Name to a Column?

G-fer

Board Regular
Joined
Jul 18, 2005
Messages
192
Hi All ....

I was wondering if it's possible to assign a name to a column and then use the column name to select a cell, as in range(name,5).select ?

G-fer
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Assuming that you have a Named Range in from the Define Names dialog box.
To select the cell in the fifth row of the named column colName, you could use the syntax
Range("colName").Cells(5, 1).Select
or
Range("colName").Range("A5").Select

A worksheet function for the same cell would be =INDEX(colName, 5, 1)

One difference between VB Cells and worksheet INDEX, is that if the 5, 1 is changed to a 5, 2 the VB won't error (it will return the 5th row of one column to the right of colName. INDEX will error.
 
Last edited:
Upvote 0
Thanks Mike, Greg ....

That should fit the bill ... I was getting sick and tired of offsets.

BTW, will the column retain its name if another column is inserted before it, or will I need to cancel and then redefine the name?

G-fer
 
Upvote 0
"will the column retain its name if another column is inserted before it, or will I need to cancel and then redefine the name?"

Yes, the column of cells will retain its name if another column is inserted before it.
If column D is named colDCells, and the user inserts a new column D, those cells that used to be in column D will still be named colDCells.
 
Upvote 0

Forum statistics

Threads
1,224,517
Messages
6,179,240
Members
452,898
Latest member
Capolavoro009

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