How to Insert the Same Text in Every Other Row in Excel

Excel is an excellent application for mathematical operations, but sometimes you just need to organize data in tables that have text labels in every other row. We will walk through different methods to complete this task.

For this tutorial, we will use a data set of “Name”, “Date”, and “Salary”.

Using Visual Basic for Applications Code to Insert the Same Text in Every Other Row

You must enable the Developer Tab in Excel before inserting the VBA code into the worksheet.

  1. Tap on File and click on Options toward the bottom of the menu.
Image showing the File menu in Excel highlighted.

Image of red arrow pointing down.
Image showing the Options menu highlighted.

  1. Click Customize Ribbon on the left-hand side.
Image displaying Excel Options with the Customize Ribbon Option highlighted.

  1. Place a check in the box next to Developer in the Main Tabs Category and press the OK button.
Image showing a checkmark placed next to the Developer Tab and the OK button highlighted.

  1. The Developer Tab appears in the Ribbon.
Image showing the Developer Tab in the Ribbon.

  1. Tap Visual Basic in the Developer menu to open the Visual Basic for Applications dialog box.
Image displaying Visual Basic in the Developer Tab.

  1. Tap the Insert menu and select Module.
Image showing Module in the Insert menu of the Visual Basic for Applications dialog box.

  1. In the blank Module window, paste the following code and press Run.

Sub inserttexteveryonerow()
Dim Last As Integer
Dim emptyRow As Integer
Last=Range(“A” & Rows.Count).End(xlUp).Row
For emptyRow=Last to 2 Step -1
If Not Cells(emptyRow,1).Value =”” Then
Rows(emptyRow).Resize(1).Insert
Range(Cells(emptyRow,”A”), Cells(emptyRow, “C”)).Value=Array(“Name”, “Start Date”, “Salary”)
End If
Next emptyRow
End Sub

Image of red arrow pointing down.

Image displaying Visual Basic Code in the Module Window for inserting labeled rows in Excel.

Important Notes:

  • The data in your worksheet must start in cell A1
  • Change the text surrounded by quotations of the Array to whatever you want them to be.
  • The letters “A” and “C” represent the range of cells where the text appears.

  1. The text appears in every other row of the worksheet.
Image showing the results of running the Visual Basic Macro with the text labels highlighted.

Use Keyboard Shortcuts to Insert the Same Text in Every Other Row in Excel

Using keyboard shortcuts is a quick and easy technique to insert the same text in every other row in Excel; however, keyboard shortcuts are time-consuming when dealing with large amounts of data.

  1. Create blank rows for the new text.
Image displaying blank rows after each row of data.

  1. Select all the blank cells in the column.
  2. Press F2 on your keyboard to turn on Editing Mode in the last cell of the group. You will see the cursor flashing in the cell.
Image showing every other cell highlighted with cursor in the last cell.

  1. Type the text you want in the cell.
Image displaying label text in the last active cell of the worksheet.

  1. Press CTRL + Enter, and the text appears in the remaining blank cells.
Image showing the "Name" text in the blank cells after pressing CTRL + ENTER.

  1. Repeat these steps for any remaining columns in your worksheet.

Then you can remove the text before or after a character (if present) after.

Use the Fill Handle to Insert the Same Text in Every Other Row in Excel

The Fill Handle in Excel works by copying a pattern that you create and it works to insert the same text in every other row in a worksheet.

  1. Create your text labels in the worksheet and highlight the row with the labels and the blank row beneath it.
Image displaying the Name, Start Date, and Salary text labels and the row beneath them highlighted.

  1. Place the mouse over the square in the bottom right-hand corner of the selected area, so the cursor turns into a black cross.
Image displaying the text labels and the row beneath them in addition to the Fill Handle box highlighted.

  1. Press the Fill Handle box and drag it down through the rows until you have the desired number of labels.
Image showing the text labels in every other row of the worksheet.

  1. Now you can copy the data under the labels.
Image displaying complete data with text labels for every other row.

Conclusion

Now you have a couple of quick, easy ways to insert the same text in every other row of your worksheet. We encourage you to continue learning more Excel tricks from our blog.

This includes adding alternate row colors to make the entries pop out more.

Leave a Comment