What is the function to get the current line number and the current column name for a cell in Excel?
|
feedback
|
|
You can use the For example, if you enter If you want the column letter, you can use the Just an FYI, I got 64 from an ASCII table. You could also use the Lastly, if you want this to work with two-letter columns, you need the following formula:
I'm not sure if there is an easier way to do it or not, but I know that works from cell | |||||||
feedback
|
|
Another possible way would be to use something like this:
Where So if you were to copy the above string to cell A1 of 'MySheet2', it would evaluate as This would enable you, for example, to use | ||||
|
feedback
|
|
I'm not sure VBA solutions are accepted here but this was my solution.
Then put =COLUMNLETTER() in any cell and you will get the column letter. :-P This User Defined Function works great when creating generic formulas inside the INDIRECT function. | |||
|
feedback
|
LINandCOLbut the problem is they return numbers, and I need the column letter toINDIRECTit. – Jader Dias Jul 28 '11 at 14:36OFFSETfunction in conjunction with, or instead of, theINDIRECTformula in that case. If you want to use strings, though, I also updated my answer. – Breakthrough Jul 28 '11 at 14:39