Consulting

Results 1 to 3 of 3

Thread: Return named range with vba

  1. #1
    VBAX Mentor Sir Babydum GBE's Avatar
    Joined
    Mar 2005
    Location
    Cardiff, UK
    Posts
    499
    Location

    Return named range with vba

    Hi

    This isn't working:
    [vba]wsR.Cells(iRow, 4).Value = mySite[/vba]
    what i want to do is return the contents of the cell i've named "mySite" (as a named range in the workbook) to the destination cell.

    This just returns a blank

    How do I write it correctly please?
    Have a profound problem? Need a ridiculous solution? Post a question in Babydum's forum

  2. #2
    Knowledge Base Approver
    The King of Overkill!
    VBAX Master
    Joined
    Jul 2004
    Location
    Rochester, NY
    Posts
    1,727
    Location
    SBD

    [vba]wsR.Cells(iRow, 4).Value = Range("mySite").Value
    'or
    wsR.Cells(iRow, 4).Value = wsR.Range("mySite").Value[/vba]
    Matt

  3. #3
    VBAX Mentor Sir Babydum GBE's Avatar
    Joined
    Mar 2005
    Location
    Cardiff, UK
    Posts
    499
    Location
    Quote Originally Posted by mvidas
    SBD

    [vba]wsR.Cells(iRow, 4).Value = Range("mySite").Value
    'or
    wsR.Cells(iRow, 4).Value = wsR.Range("mySite").Value[/vba]
    I feel very daft at the moment.

    Thanks!
    Have a profound problem? Need a ridiculous solution? Post a question in Babydum's forum

Posting Permissions

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