Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default How to get row number from R[4]C

I need to get the integer value from the address R[4]C, any ideas ?







  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default How to get row number from R[4]C

I'm not quite sure how you got this string, but this worked ok for me:

Option Explicit
Sub testme()
Dim myStr As String
Dim OpenBrktPos As Long
Dim CloseBrktPos As Long
myStr = "R[433]C"

OpenBrktPos = InStr(1, myStr, "[", vbTextCompare)
CloseBrktPos = InStr(1, myStr, "]", vbTextCompare)

Debug.Print Mid(Left(myStr, CloseBrktPos - 1), OpenBrktPos + 1)

End Sub


But =r[4]c means that it's 4 rows down from the cell containing that formula (in
the same column).

Goofy wrote:

I need to get the integer value from the address R[4]C, any ideas ?


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default How to get row number from R[4]C

myStr = "R[433]C"
was really
myStr = "R[4]C"
On my first test.


Dave Peterson wrote:

I'm not quite sure how you got this string, but this worked ok for me:

Option Explicit
Sub testme()
Dim myStr As String
Dim OpenBrktPos As Long
Dim CloseBrktPos As Long
myStr = "R[433]C"

OpenBrktPos = InStr(1, myStr, "[", vbTextCompare)
CloseBrktPos = InStr(1, myStr, "]", vbTextCompare)

Debug.Print Mid(Left(myStr, CloseBrktPos - 1), OpenBrktPos + 1)

End Sub

But =r[4]c means that it's 4 rows down from the cell containing that formula (in
the same column).

Goofy wrote:

I need to get the integer value from the address R[4]C, any ideas ?


--

Dave Peterson


--

Dave Peterson
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
Sumif number is greater than a number but less than another number lulu151 Excel Discussion (Misc queries) 2 May 7th 10 07:12 PM
How can I click on a telephone number in an Excel 2002 spreadsheet, and have the number dialed? jbclem Excel Discussion (Misc queries) 2 August 13th 09 01:57 AM
How to calculate number of occurencies of a specific number number Stefan Excel Discussion (Misc queries) 4 September 8th 08 08:33 AM
excel format cells/Number/Category: Number problem Matts Excel Discussion (Misc queries) 5 December 9th 04 09:47 PM
Rounding a number to a multiple quantity that adds to a fixed total number wjlo Excel Worksheet Functions 1 November 9th 04 04:43 PM


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

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

About Us

"It's about Microsoft Excel"