• Autofill (Excel 2002)

    Author
    Topic
    #447414

    I have the following code in a macro that works correctly, however I need to make it stay as text or something as when it autofills it adds a number to it… for example the data in range A2 is JAN07, and when it is autofilled by the macro, cell B2 says FEB07, C2 says MAR07, etc. Likewise in cell B2 I have the financial division, which is 04, then when it is autofilled cell B3 is 05, cell B4 is 06, etc. I really just want all the cells to stay at the JAN07 and the 04. I’ve formatted the cells in Excel to text and it didn’t work. Any ideas???
    Thanks!!
    Lana

    Dim x As Long

    Range(“C65536”).Select
    x = -Range(Selection, Selection.End(xlUp)).Rows.Count + 65537

    Range(“A2:B2”).Select
    Selection.AutoFill Destination:=Range(“A2:B” & x)

    Range(“F2:G2”).Select
    Selection.AutoFill Destination:=Range(“F2:G” & x)

    Viewing 0 reply threads
    Author
    Replies
    • #1090972

      I’d use FillDown instead of AutoFill for those columns that shouldn’t change:

      Range(“A2:B” & x).FillDown

    Viewing 0 reply threads
    Reply To: Autofill (Excel 2002)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: