Sub InsertSameRows() ' 2016.10.14 by Towa Tachibana ' This macro was developed to make IDs for Panel data. ' This macro inserts rows and copy the original row into a new row ' Before initiating this macro, you need to choose the first row indicating the name (label) of the variable (column: in my case this is always row 12) ' firm1 ' firm2 ' firm3 ' 'This macro makes 'firm1 'firm1 'firm2 'firm2 'firm3 'firm3 Dim i As Integer Dim j As Integer i = ActiveCell.Row + 1 ' + 1 because the data starts from just after the title of the variable j = ActiveCell.Column Do While Cells(i, j).Value <> "" Cells(i + 1, j).Select Selection.EntireRow.Insert 'insert a row just below the first row; firm 1 Range(Cells(i, j), Cells(i, j + 1)).Copy Cells(i + 1, j) 'copy firm 1 into the new row Cells(i, j + 2).Value = 2014 Cells(i + 1, j + 2).Value = 2015 'write a necessary information into the other cells ' For example this is the case you want to have two period data of Year 2014 and 2015 i = i + 2 ' due to a new row, you have to go to the 2 rows belwo Loop End Sub