Results 1 to 5 of 5

AutoFill of Dynamic Range

Threaded View

  1. #4
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: AutoFill of Dynamic Range

    Below will do the same..

    Sub Macro5()
        With Sheets("Data03")
            lrow = .Range("A" & Rows.Count).End(xlUp).Row
            .Range("X" & lrow + 1 & ":BV" & lrow + 1).Formula = "=SUM(X3:X" & lrow & ")"
        End With
    End Sub
    and for your query..

    Sub Macro5()
        With Sheets("Data03")
            lrow = .Range("A" & Rows.Count).End(xlUp).Row
            .Range("X" & lrow + 1).Formula = "=SUM(X3:X" & lrow & ")"
            .Range("X" & lrow + 1).Select
            '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
    Last edited by Debraj Roy; 12-17-2013 at 06:00 PM.
    Regards!
    =DEC2HEX(3563)

    If you like someone's answer, click the star to give them a reputation point for that answer...

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