ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Extract Column Letter from Cell Reference in another Cell (https://www.excelbanter.com/excel-discussion-misc-queries/124044-extract-column-letter-cell-reference-another-cell.html)

JKBEXCEL

Extract Column Letter from Cell Reference in another Cell
 
Hi

I have a cell with references another sheet in the same workbook and I
would like to use place this column letter of the cell that is
referenced in a separate cell

Example:

In Worksheet 1

Cell A2 formula = 'Worksheet2'!D18
b2 desired value D

Thanks


Gary''s Student

Extract Column Letter from Cell Reference in another Cell
 
Try this UDF:

Function letter(r As Range) As String
Dim rr As Range
S2 = Split(r.Formula, "!")
Set rr = Range(S2(1))
S3 = Split(rr.Address, "$")
letter = S3(1)
End Function
--
Gary's Student


"JKBEXCEL" wrote:

Hi

I have a cell with references another sheet in the same workbook and I
would like to use place this column letter of the cell that is
referenced in a separate cell

Example:

In Worksheet 1

Cell A2 formula = 'Worksheet2'!D18
b2 desired value D

Thanks



Gary''s Student

Extract Column Letter from Cell Reference in another Cell
 
Try this UDF:


--
Gary's Student


"JKBEXCEL" wrote:

Hi

I have a cell with references another sheet in the same workbook and I
would like to use place this column letter of the cell that is
referenced in a separate cell

Example:

In Worksheet 1

Cell A2 formula = 'Worksheet2'!D18
b2 desired value D

Thanks




All times are GMT +1. The time now is 04:04 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com