Autofill Range

  • I am new to this site, and not sure where to post my question. I am trying to create a macro that will autofill a column to the last cell of where data is in another column. I export data that the number of rows varies from one month to another. Below is what I was trying to use but I get a syntex error in the 3rd entry.


    Range("A4").Select
    ActiveCell.FormulaR1C1 = "833"
    Range("A4").AutoFill Range("A4:A" & Range("D" Rows.Count).End(x1Up).Row)

  • Hi Haygunnohm, I created a new thread for you - there should be a "New" Button on each forum.


    You had two typo's

    Code
    Range("A4").AutoFill Range("A4:A" & Range("D" Rows.Count).End(x1Up).Row)


    should be this

    Code
    Range("A4").AutoFill Range("A4:A" & Range("D" & Rows.Count).End(xlUp).Row)


    The second typo was in "xlup" - XLUP, you wrote X1UP
    Edit: But I see pike has already answered :)

    _______________________________________________
    There are 10 types of people in the world. Those that understand Binary and those that dont. :P


    Why are Halloween and Christmas the same? Because Oct 31 = Dec 25... ;)

    _______________________________________________

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!