Results 1 to 2 of 2

Thread: [RESOLVED] Dynamic Autofill Range (Both start and end variable)

  1. #1
    Junior Member
    Join Date
    Jul 12
    Posts
    26

    Resolved [RESOLVED] Dynamic Autofill Range (Both start and end variable)

    Hi guys

    I have calcualted the first and last rows being used in a sheet.

    FirstRow and LastRow are variables which will change frequently.


    I now need to autofill a formula i have to cover the range.

    Usually I would just do

    Selection.Autofill Destination:=Range("a1:a" & LastRow)

    Does anyone no the notation for what I want? I tried


    Selection.Autofill Destination:=Range("a & FirstRow:a" & LastRow) but didnt work, just struggling with the notation.

    Thanks

  2. #2
    Fanatic Member
    Join Date
    Oct 08
    Location
    Midwest Region, United States
    Posts
    1,022

    Re: Dynamic Autofill Range (Both start and end variable)

    Maybe this instead:

    Code:
    Range("a" & firstRow, "a" & lastRow)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •