Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student
 
Posts: n/a
Default cell address from formula

If your formula is always a reference with a sheet name at the beginning then
try this UDF:

Function rownummber(r As Range) As Long
Dim s As String, L As Long
rownummber = 0
If r.HasFormula Then
s = r.Formula
L = Len(s)
k = InStr(s, "!")
If k = 0 Then Exit Function
s = Right(s, L - k - 1)
If IsNumeric(s) Then
rownummber = CLng(s)
Else
rownummber = CLng(Right(s, Len(s) - 1))
End If
End If
End Function
--
Gary''s Student


"JohnJC" wrote:

This should be easy i am sure.

I want to get the row address out of a cell reference and into another cell.

EG given cell B2 which contains =sheet!a345 I would like to store 345 in C2.

Is there a formula which allows me to do this?

thanks in advance

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
how do I write a formula: if (cell address) is less than X add Y CTrophyMan Excel Discussion (Misc queries) 4 December 1st 05 06:17 PM
cell address of occurence of a vlookup formula [email protected] Excel Worksheet Functions 5 October 26th 05 06:53 AM
Formula checking multiple worksheets sonic-the-mouse Excel Worksheet Functions 2 June 5th 05 07:48 PM
Creating a check mark box MarthaSue Setting up and Configuration of Excel 18 April 28th 05 12:31 AM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


All times are GMT +1. The time now is 01:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"