+ Reply to Thread
Results 1 to 3 of 3

How to extend Range.AutoFill Destination down an addition 3 rows?

Hybrid View

  1. #1
    Registered User
    Join Date
    12-15-2011
    Location
    Charleston, SC
    MS-Off Ver
    Excel 2010
    Posts
    43

    How to extend Range.AutoFill Destination down an addition 3 rows?

    With my last post, I was able to use the code in another part of my macro, but it needs to extend an extra 3 rows. I'm sure this has to do with offset, but have tried several different way and only get errors.

    Here is the code and it autofills down to the last row, but how can it continue past for 3 more rows? There is another part of the macro that will add data to the sheet for an additional 3 rows and would like not having to copy and drag as it should be easier.

        Dim LastRow As Long
        LastRow = Range("I" & Rows.Count).End(xlUp).Row
        Range("K5:L5").AutoFill Destination:=Range("K5:L" & LastRow)
    Last edited by BBoydAnchor; 12-31-2011 at 10:52 AM.

  2. #2
    Forum Contributor JP Romano's Avatar
    Join Date
    10-09-2008
    Location
    Princeton, NJ
    MS-Off Ver
    2010
    Posts
    500

    Re: How to extend Range.AutoFill Destination down an addition 3 rows?

    Sorry if this shows up twice - not sure if my response posted but I just don't see it, but...

    If all you want to do is extend the range, just add the desired number to the variable:
    LastRow = Range("I" & Rows.Count).End(xlUp).Row + 3

    Is that what you're after?

  3. #3
    Registered User
    Join Date
    12-15-2011
    Location
    Charleston, SC
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: How to extend Range.AutoFill Destination down an addition 3 rows?

    Thanks JP. Adding the "+ 3" to the code did exactly what I wanted it to do. I knew it was probably a simple solution, but could not figure it out. Thanks and I hope you have a Happy New Year!

    Brian

+ 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