Josh Ng
Josh Ng

Reputation: 198

Double Click Bottom Right of Auto Fill

seems like an easy question here, but is there a code to simulate the double clicking of bottom right of fill handle? So I would have 3 cells selected, from column A, B and C; and the autofill should duplicate the values inside down all the blanks in A, B and C till there is no more blank more blanks in C.

enter image description here

to this:

enter image description here

Upvotes: 1

Views: 1342

Answers (1)

Gary's Student
Gary's Student

Reputation: 96753

Give this a try:

Sub FillDown()
    Dim rng As Range

    Set rng = Range(Selection, Selection.End(xlDown))
    Set rng = rng.Resize(rng.Rows.Count - 1, rng.Columns.Count)

    rng.FillDown
End Sub

Upvotes: 4

Related Questions