Results 1 to 4 of 4

[SOLVED] Autofill formulas from last two rows to the next two rows

Threaded View

  1. #1
    Registered User
    Join Date
    01-24-2014
    Location
    Nanaimo, BC
    MS-Off Ver
    Excel 2010
    Posts
    12

    [SOLVED] Autofill formulas from last two rows to the next two rows

    Hi Guys,
    I am attempting to select the last two rows, and autofill the formulas in those rows to the next two rows. I plan to call this eventually on a change event so: Data is entered into column D, that triggers the last two rows to autofill to the next two, so that there are always enough new rows for the user and they don't have to autofill themselves. I started by recording a macro and modifying some of the code but I am getting an error when it tries to run: "Compile Error: Invalid or unqualified reference" and it highlights ".Rows". I am sure I am missing something simple. Here is what I have so far:


    Sub AddRows()
    '
    ' AddRows Macro
    ' Adds rows when you run out.
    '
    ' Keyboard Shortcut: Ctrl+Shift+R
    Dim lRow As Long, llRow As Long
    
        lRow = .Range("A" & .Rows.Count).End(xlUp).Row
        llRow = lRow - 1
        Range("A" & llRow & ":AB" & lRow).Select
    ' Range("A2584:AB2585").Select
        Selection.AutoFill Destination:=Range("A2584:AB2587"), Type:=xlFillDefault
        Range("A2584:AB2587").Select
    End Sub
    Last edited by geoidwalker; 02-12-2015 at 05:33 PM. Reason: Solved

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Want to autofill cells with formulas in a range with a dynamic numbe of rows
    By hgeo24 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-06-2014, 05:59 PM
  2. Autofill formulas down rows of new data
    By eskyec in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-30-2013, 05:17 PM
  3. Copy cell values (not formulas) from a pair of rows then paste in a new set of rows
    By pelle3988 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-23-2013, 02:49 PM
  4. [SOLVED] Autofill formula down rows with skipping rows
    By vickybarda1 in forum Excel General
    Replies: 7
    Last Post: 08-28-2012, 11:52 AM
  5. Insert rows and autofill formulas
    By modytrane in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-05-2008, 10:08 AM

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