Results 1 to 4 of 4
  1. #1
    Lounger
    Join Date
    Apr 2008
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Content of a Named Range (excel 2003)

    I have a named range called Wallet that references one cell.
    In that current reference is the word "Money".

    I want to display the text ("Money") using that named range in another cell on another sheet. I thought it would be something like:

    Sub CollectData()
    Worksheets("InterimOutput").Activate
    Cells(2, 1).Value = Range("Wallet").Text
    End Sub

    But I guess I get the actual address returned and not the text itself. Can I display the actual text in a named range if it only points to one cell? This named range pointer will change conditionally, so I want to display on the worksheet whatever I am pointing to.

  2. #2
    Lounger
    Join Date
    Apr 2008
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Content of a Named Range (excel 2003)

    This may also help. I set up the named through VBA as such:

    ThisWorkbook.Names.Add Name:="Wallet", RefersToR1C1:="=" & "!R" & r & "C" & c

    where I pass in row and column numbers.

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Content of a Named Range (excel 2003)

    You should include the name of the sheet in the definition of the named range:
    <code>
    ThisWorkbook.Names.Add Name:="Wallet", RefersToR1C1:="='Sheet1'!R" & r & "C" & c
    </code>
    where Sheet1 is the name of the sheet.

  4. #4
    Lounger
    Join Date
    Apr 2008
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Content of a Named Range (excel 2003)

    Thanks!

Posting Permissions

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