Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default convert A1 to R1C1 in VBA

Is there a function that will do the following?:

convtA1toR1C1(strA1 As String) As String

So that with the following input I would get the following return?

convtA1toR1C1("F23:AL4257") = "R23C6:R4257C38"

Thanks,

--
Bill Reed

"If you can't laugh at yourself, laugh at somebody else"

Message posted via http://www.officekb.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default convert A1 to R1C1 in VBA

I need this function because in spite of successfully setting the reference
to xlR1C1 in code, the currentregion.address returns in A1 style.

ragtopcaddy wrote:
Is there a function that will do the following?:

convtA1toR1C1(strA1 As String) As String

So that with the following input I would get the following return?

convtA1toR1C1("F23:AL4257") = "R23C6:R4257C38"

Thanks,


--
Bill Reed

"If you can't laugh at yourself, laugh at somebody else"

Message posted via http://www.officekb.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default convert A1 to R1C1 in VBA

not sure if this will help, just wanted to give it a try. it's mostly from the
help file

Function convtA1(strA1 As String) As String
MsgBox Application.ConvertFormula( _
Formula:=strA1, _
fromReferenceStyle:=xlA1, _
toReferenceStyle:=xlR1C1)

End Function


entered like this:
=convta1("SUM(B10:B20)")
--


Gary


"ragtopcaddy via OfficeKB.com" <u9289@uwe wrote in message
news:853bf2aeafc06@uwe...
I need this function because in spite of successfully setting the reference
to xlR1C1 in code, the currentregion.address returns in A1 style.

ragtopcaddy wrote:
Is there a function that will do the following?:

convtA1toR1C1(strA1 As String) As String

So that with the following input I would get the following return?

convtA1toR1C1("F23:AL4257") = "R23C6:R4257C38"

Thanks,


--
Bill Reed

"If you can't laugh at yourself, laugh at somebody else"

Message posted via http://www.officekb.com



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default convert A1 to R1C1 in VBA

You can get the R1C1 style address directly via the Address property's
optional arguments. For example, using ActiveCell for the Range object for
this example (use your own Range in place of it)...

Debug.Print ActiveCell.CurrentRegion.Address(ReferenceStyle:=x lR1C1)

Check out the help files for Address to see what other optional arguments
are available.

Rick


"ragtopcaddy via OfficeKB.com" <u9289@uwe wrote in message
news:853bf2aeafc06@uwe...
I need this function because in spite of successfully setting the reference
to xlR1C1 in code, the currentregion.address returns in A1 style.

ragtopcaddy wrote:
Is there a function that will do the following?:

convtA1toR1C1(strA1 As String) As String

So that with the following input I would get the following return?

convtA1toR1C1("F23:AL4257") = "R23C6:R4257C38"

Thanks,


--
Bill Reed

"If you can't laugh at yourself, laugh at somebody else"

Message posted via http://www.officekb.com


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default convert A1 to R1C1 in VBA

Thanks All.

I'll try your suggestions

Bill

Rick Rothstein (MVP - VB) wrote:
You can get the R1C1 style address directly via the Address property's
optional arguments. For example, using ActiveCell for the Range object for
this example (use your own Range in place of it)...

Debug.Print ActiveCell.CurrentRegion.Address(ReferenceStyle:=x lR1C1)

Check out the help files for Address to see what other optional arguments
are available.

Rick

I need this function because in spite of successfully setting the reference
to xlR1C1 in code, the currentregion.address returns in A1 style.

[quoted text clipped - 8 lines]

Thanks,


--
Bill Reed

"If you can't laugh at yourself, laugh at somebody else"

Message posted via http://www.officekb.com

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 CONVERT R1C1 REFERECE STYLE SPREADSHEET TO AN A1 REFEREN. afritex Excel Worksheet Functions 3 March 8th 08 11:38 PM
help on Converting R1C1 to A1 and A1 to R1C1..tia sa2 temp Excel Discussion (Misc queries) 3 September 13th 07 08:31 AM
help on Converting R1C1 to A1 and A1 to R1C1..tia sa2 temp Excel Worksheet Functions 3 September 13th 07 08:31 AM
help on Converting R1C1 to A1 and A1 to R1C1..tia sa2 temp Excel Programming 3 September 13th 07 08:31 AM
convert R1C1 (international) address to A1 Suresh[_4_] Excel Programming 0 September 5th 06 03:07 PM


All times are GMT +1. The time now is 02:30 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"