Filling a Set Number of Cells

Written by Allen Wyatt (last updated August 21, 2025)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, 2021, 2024, and Excel in Microsoft 365


When Dennis is developing a worksheet, he knows he can use the fill handle to drag downward to fill cells with a formula (the formula in the cell that he's dragging down). He wonders, though, if there is a fast way to fill downwards a specific number of cells, such as 50 or 100 cells.

Short of using a macro, there are two very easy ways to accomplish this task. Here is the first approach:

  1. Select the cell you want to fill downward. For instance, if you want to fill cell C2 downward, select that cell.
  2. Press Ctrl+C. The contents of the cell are copied to the Clipboard.
  3. In the Name box (just above the row numbers and to the right of the column letters) enter the target range, such as C3:C50. When you press Enter, the range of cells is selected.
  4. Press Enter another time. The selected range is filled with the contents of the Clipboard.

An even quicker way that bypasses the Clipboard is to follow these steps:

  1. Select cell C2.
  2. In the Name box, enter the entire target range, including the currently selected cell. So, you would enter C2:C50. When you press Enter, the entire range is selected.
  3. Press Ctrl+D. The formula in the first cell of the range (C2) is copied to the other cells in the range.

If you prefer to go a macro-based route, the following is one approach:

Sub FillRows()
    Dim Nrows As Variant

    Nrows = Application.InputBox("Fill how many rows?", Type:=1)
    If Nrows Then
        If Nrows < 0 And Abs(Nrows) >= ActiveCell.Row Then
            Nrows = -ActiveCell.Row + 1
        End If
        ActiveSheet.Range(ActiveCell.Address).AutoFill _
          Destination:=Range(Cells(ActiveCell.Row, _
          ActiveCell.Column), Cells(ActiveCell.Row + Nrows, _
          ActiveCell.Column)), Type:=xlFillDefault
    End If
End Sub

To use the macro, select the cell you want to use in the fill, then run it. You are asked for how many cells you want to fill, and then the macro dutifully fills that many cells down (a positive value) or up (a negative value). If you enter a negative value that is greater than the number of rows above the current cell, then the operation adjusts the number of rows to fill.

The benefit to using a macro-based approach is that you don't have to calculate the range of cells you want to fill. You can simply specify how many, and the macro takes care of the rest. If you assign the macro to a shortcut key, then you can invoke it with a single keystroke.

Note:

If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (13514) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, 2021, 2024, and Excel in Microsoft 365.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Selecting Noncontiguous Ranges with the Keyboard

It's easy to select non-contiguous ranges using the mouse but may seem more daunting if you are simply using the ...

Discover More

Weird Actions for Arrow Keys and Enter

If your arrow keys and the Enter key aren't working as you expect them to, the problem could have any number of causes. ...

Discover More

Adjusting the Order of Items in a Chart Legend

When charting your data, a legend is always a nice finishing touch. You may want to change the order in which items ...

Discover More

Professional Development Guidance! Four world-class developers offer start-to-finish guidance for building powerful, robust, and secure applications with Excel. The authors show how to consistently make the right design decisions and make the most of Excel's powerful features. Check out Professional Excel Development today!

More ExcelTips (ribbon)

Capitalizing Just a Surname

Changing the capitalization of text is, believe it or not, a common task in Excel. Common or not, it can be frustrating ...

Discover More

Pasting Excel Data within Word's Page Margins

The programs in the Microsoft Office suite are designed to work with each other easily. Sometimes there can be hiccups ...

Discover More

Colors No Longer Work

It can be disconcerting if you are editing a workbook and can no longer change colors for cells in the workbook. This tip ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is five more than 1?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.