Closed Thread
Results 1 to 7 of 7

Obtani "R1:C1" format of a Range

  1. #1
    Raph
    Guest

    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. #2
    Niek Otten
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    > Hi.
    > I have a range object. I want to determine the:
    >
    > "A1:C10"
    >
    > Format of the range. How do I get that?
    >
    > Thanks




  3. #3
    Raph
    Guest

    Re: 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" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hi.
    > > I have a range object. I want to determine the:
    > >
    > > "A1:C10"
    > >
    > > Format of the range. How do I get that?
    > >
    > > Thanks

    >
    >
    >


  4. #4
    Dave Peterson
    Guest

    Re: 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. #5
    Raph
    Guest

    Re: 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. #6
    Dave Peterson
    Guest

    Re: 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

  7. #7
    Dave Peterson
    Guest

    Re: 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

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1