Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,440
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default 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




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default 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



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
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
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
Convert range values to correct "hh:mm:ss" format. [email protected] Excel Programming 4 November 13th 05 10:07 PM
use variable in Workbooks("book1").Worksheets("sheet1").Range("a1" Luc[_3_] Excel Programming 2 September 28th 05 08:37 PM
Using "Cells" to write "Range("A:A,H:H").Select" Trip Ives[_2_] Excel Programming 3 June 5th 04 03:13 PM


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