Results 1 to 6 of 6
  1. #1
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Auto define Name Range (2003 sp3)

    I don't understand the relationship between the code and the workbook you attached. There is no worksheet named 'Open CRs' and there are no data in A5 (=R5C1).

  2. #2
    4 Star Lounger
    Join Date
    May 2002
    Location
    US
    Posts
    439
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Auto define Name Range (2003 sp3)

    Uhhhh, Hold that thought. deleted too much information. Will re-attach.

    thanks for seeing that.

    Brad

  3. #3
    4 Star Lounger
    Join Date
    May 2002
    Location
    US
    Posts
    439
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Auto define Name Range (2003 sp3)

    <P ID="edit" class=small>(Edited by bradjedis on 13-Dec-06 13:20. Re-attached file with more data.)</P>Greetings,
    I have the below code, what I am wanting to do is define and redefine a named range. the data will be changing in length, but from left to right remains the same number of columns. the third column begins the stable data. Meaning column 3 will always have data. Will need to include column 1 and 2. A sample is included.

    Sub DefineDataRange()
    '
    '
    '

    '

    ActiveWorkbook.Names.Add Name:="data", RefersToR1C1:= _
    "='Open CRs'!R5C1:xlLastCell"
    Application.Goto Reference:="R5C3"
    Selection.AutoFilter
    End Sub


    thanks,
    Brad

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

    Re: Auto define Name Range (2003 sp3)

    Does this work?

    Dim n As Long
    n = Worksheets("Open CRs").Range("C65536").End(xlUp).Row
    ActiveWorkbook.Names.Add Name:="data", RefersToR1C1:= _
    "='Open CRs'!R5C1:R" & n & "C224"

  5. #5
    4 Star Lounger
    Join Date
    May 2002
    Location
    US
    Posts
    439
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Auto define Name Range (2003 sp3)

    Sorry for the delay.... Had to sep out for a bit.

    I will give it a try and let you know....

    Brad

  6. #6
    4 Star Lounger
    Join Date
    May 2002
    Location
    US
    Posts
    439
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Auto define Name Range (2003 sp3)

    Hans,
    That worked, Guess I was kind of close.

    Thanks,
    Brad

Posting Permissions

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