Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003
    Posts
    311

    Unanswered: Adding A named range

    In order to import data to access i need to name a range in my file. I have the info in the format i want i just now have to name it. I used the macro and ended up with this code :


    Range("A1").Select
    Range(Selection, Selection.End(xlDown)).Select
    Range(Selection, Selection.End(xlToRight)).Select

    ActiveWorkbook.Names.Add Name:="tblImports", RefersToR1C1:= _
    "=Management!R1C1:R45C8"


    i want to select from a1 down and accross and this is fine, but the refers to in the .add Name isnt going to be the same the next time i import! it works fine for the data i use to record the macro but next time the data will be a different size, and i want to start from a1 and go down and accross to select all . How can i do this?


    M~

  2. #2
    Join Date
    Oct 2003
    Posts
    311
    Range("A1").Select
    Range(Selection, Selection.End(xlDown)).Select
    Range(Selection, Selection.End(xlToRight)).Select

    Selection.Name = "tblImports"

Posting Permissions

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