Results 1 to 5 of 5

AutoFill of Dynamic Range

Threaded View

  1. #1
    Registered User
    Join Date
    04-19-2013
    Location
    midwest usa
    MS-Off Ver
    2007, 2010
    Posts
    16

    AutoFill of Dynamic Range

    I'm trying to convert the static value of "X372:BV372" in line 1 on the screenshot into a dynamic range based on last row, but I'm getting an "AutoFill method of Range class failed" with my modifed syntax in line 2 on the screenshot..

    Sub Macro5()
        With Sheets("Data03")
            lrow = .Range("A" & Rows.Count).End(xlUp).row
            .Range("X" & lrow + 1).Formula = "=SUM(X3:X" & lrow & ")"
            'Selection.AutoFill Destination:=Range("X372:BV372"), Type:=xlFillDefault <---- Recorded with the Excel Macro recorder
            Selection.AutoFill Destination:=Range("X" & lrow + 1 & ":BV" & lrow + 1), Type:=xlFillDefault <---- My modified syntax that errors out
        End With
    End Sub
    Attached Images Attached Images

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Autofill using a Macro when range is dynamic
    By CPSmurf in forum Excel Programming / VBA / Macros
    Replies: 24
    Last Post: 09-03-2013, 05:54 PM
  2. VBA Code - Autofill with a Dynamic Range
    By Jurij in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-24-2013, 02:27 AM
  3. Need a macro to autofill a dynamic range
    By missmea2005 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-13-2012, 09:15 AM
  4. Vlookup and autofill a dynamic range
    By ajay1967 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-20-2012, 07:36 PM
  5. Autofill using Dynamic Range (Last Column) and Last Row
    By goldenr2 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-05-2011, 11:21 PM

Tags for this Thread

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