ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Obtani "R1:C1" format of a Range (https://www.excelbanter.com/excel-programming/348571-obtani-r1-c1-format-range.html)

Raph

Obtani "R1:C1" format of a Range
 
Hi.
I have a range object. I want to determine the:

"A1:C10"

Format of the range. How do I get that?

Thanks

Niek Otten

Obtani "R1:C1" format of a Range
 
Function test(a As Range) As String
test = Replace(a.Address, "$", "")
End Function

--
Kind regards,

Niek Otten

"Raph" wrote in message
...
Hi.
I have a range object. I want to determine the:

"A1:C10"

Format of the range. How do I get that?

Thanks




Raph

Obtani "R1:C1" format of a Range
 
I should have prefaced. I'm not using VBA, rather C# in an AddIn.

"Niek Otten" wrote:

Function test(a As Range) As String
test = Replace(a.Address, "$", "")
End Function

--
Kind regards,

Niek Otten

"Raph" wrote in message
...
Hi.
I have a range object. I want to determine the:

"A1:C10"

Format of the range. How do I get that?

Thanks





Dave Peterson

Obtani "R1:C1" format of a Range
 
dim myRng as range
set myrng = activesheet.range("a1:C10")
msgbox myrng.address(0,0)

Take a look in VBA's help for .address.

Raph wrote:

Hi.
I have a range object. I want to determine the:

"A1:C10"

Format of the range. How do I get that?

Thanks


--

Dave Peterson

Raph

Obtani "R1:C1" format of a Range
 
No, I want "ROWNUMBER:COLNUMBER" format for a selected range.
I don't know the "A1:C1" in my example. I want to determine that string.



"Dave Peterson" wrote:

dim myRng as range
set myrng = activesheet.range("a1:C10")
msgbox myrng.address(0,0)

Take a look in VBA's help for .address.

Raph wrote:

Hi.
I have a range object. I want to determine the:

"A1:C10"

Format of the range. How do I get that?

Thanks


--

Dave Peterson


Dave Peterson

Obtani "R1:C1" format of a Range
 
That was just the way I tested the function. myRng could have been set to
anything.

And what does rownumber:colnumber mean?

if you mean R1C1 reference style:
MsgBox myRng.Address(ReferenceStyle:=xlR1C1)





Raph wrote:

No, I want "ROWNUMBER:COLNUMBER" format for a selected range.
I don't know the "A1:C1" in my example. I want to determine that string.

"Dave Peterson" wrote:

dim myRng as range
set myrng = activesheet.range("a1:C10")
msgbox myrng.address(0,0)

Take a look in VBA's help for .address.

Raph wrote:

Hi.
I have a range object. I want to determine the:

"A1:C10"

Format of the range. How do I get that?

Thanks


--

Dave Peterson


--

Dave Peterson


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

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