+ Reply to Thread
Results 1 to 3 of 3

Autofill to last row in a database

  1. #1
    JOn Kunces
    Guest

    Autofill to last row in a database

    I have a large file but it varies in size each month. When i recorded a
    macro the file seems to copy down the column in a fixed method as shown below-

    Selection.AutoFill Destination:=Range("H2:H15952")
    Range("H2:H15952").Select

    I was wondering what i can insert in these areas so that it will AutoFill
    automatically to the bottom row of column F no matter how many cells are
    present.

    Please help me out. Thanks

    --
    Message posted via http://www.officekb.com

  2. #2
    Bernie Deitrick
    Guest

    Re: Autofill to last row in a database

    Jon,

    Selection.AutoFill Destination:=Range("H2:H" & Range("F65536").End(xlUp).Row)

    HTH,
    Bernie
    MS Excel MVP


    "JOn Kunces" <[email protected]> wrote in message news:[email protected]...
    >I have a large file but it varies in size each month. When i recorded a
    > macro the file seems to copy down the column in a fixed method as shown below-
    >
    > Selection.AutoFill Destination:=Range("H2:H15952")
    > Range("H2:H15952").Select
    >
    > I was wondering what i can insert in these areas so that it will AutoFill
    > automatically to the bottom row of column F no matter how many cells are
    > present.
    >
    > Please help me out. Thanks
    >
    > --
    > Message posted via http://www.officekb.com




  3. #3
    Registered User
    Join Date
    03-08-2004
    Posts
    12
    I am attempting to do basically the same thing and I can't get the string to work. I am inserting a column for an Id number and need it to autofill down to the last row of the database. Did you have success using the string?

    Here is a copy of the macro I am attempting to create. Any help would be appreciated.

    Selection.EntireColumn.Insert
    Range("A1").Select
    ActiveCell.FormulaR1C1 = "Id"
    Range("A2").Select
    ActiveCell.FormulaR1C1 = "1"
    Range("A3").Select
    ActiveCell.FormulaR1C1 = "2"
    Range("A4").Select
    ActiveCell.FormulaR1C1 = "3"
    Selection.AutoFill Destination:=Range("B2:B" & Range("B65536").End(xlUp).Row)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1