+ Reply to Thread
Results 1 to 7 of 7

Extending Forluma to last row

  1. #1
    Forum Contributor
    Join Date
    02-24-2010
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    195

    Unhappy Extending Forluma to last row

    Hey folks,
    Could someone have alook at the below and tell me what Im doing wrong.

    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    04-12-2011
    Location
    Leeds, England
    MS-Off Ver
    Excel 2007/2010
    Posts
    67

    Re: Extending Forluma to last row

    "'But the last row will vary each time."

    What do you mean by this please? You could maybe try something like:

    Selection.AutoFill Destination:=Range("A2:A" & activesheet.rows.count)

  3. #3
    Forum Contributor
    Join Date
    02-24-2010
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    195

    Re: Extending Forluma to last row

    Cheers for that mate.
    The contents of the Dumpfile will differ from week to week as such the maximum row will vary.

    That solution does the job alright, but I was hoping to work out somthing that just applied the formula down to the last populated row, rather than the entire file. Just for the sake of being tidy.

  4. #4
    Registered User
    Join Date
    04-12-2011
    Location
    Leeds, England
    MS-Off Ver
    Excel 2007/2010
    Posts
    67

    Re: Extending Forluma to last row

    There's a few ways to do that - as long as the cell formatting is uniform down the row this one should work fine:

    Selection.AutoFill Destination:=Range("A2:A" & range("A60000").end(xlup).row)

  5. #5
    Forum Contributor
    Join Date
    02-24-2010
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    195

    Re: Extending Forluma to last row

    That doesnt seem to work for me here.
    Error: 'Autofill method of Range class failed'
    ?

  6. #6
    Registered User
    Join Date
    04-12-2011
    Location
    Leeds, England
    MS-Off Ver
    Excel 2007/2010
    Posts
    67

    Re: Extending Forluma to last row

    try this:

    If Range("A60000").End(xlUp).Row > 2 Then
    Selection.AutoFill Destination:=Range("A2:A" & Range("A60000").End(xlUp).Row)
    End If

  7. #7
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Extending Forluma to last row

    Hi TonyforVBA

    This code finds the last row and fills down to that row
    Please Login or Register  to view this content.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

+ 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