Consulting

Results 1 to 3 of 3

Thread: Name a Range

  1. #1

    Name a Range

    I've used a relative reference to select a row and now I want to name that row. This is what I have but I don't know how to name the range.

    Range("A10").Select
    Selection.End(xlDown).Select
    ActiveCell.Offset(2, 0).Rows("1:1").EntireRow.Select

    Thanks,
    Donna

  2. #2
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    [VBA]Sub t()
    Dim r As Range
    Set r = Range("A10").End(xlDown).Offset(2, 0).Rows("1:1").EntireRow
    r.Name = "Ken"
    MsgBox Range("Ken").Address
    End Sub[/VBA]

  3. #3
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Is the Rows("1:1") necessary?

    [vba]
    Set r = Range("A10").End(xlDown).Offset(2, 0).EntireRow
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

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