.. if so try this
it will only work if you have two cells selected and both cells' contents beging with the same letters (e.g. MM22 MM45, not MA22 MM45).
Sub fill_rows()
Dim val1 As String, val2 As String, txt1 As String, xNum As Long, xNum2 As Long, RowNum As Long
'establish where letters end and numbers begin in each cell value
xNum = 1
Do While Not IsNumeric(Mid(Selection.Cells(1).Value, xNum, 1))
xNum = xNum + 1
Loop
xNum2 = 1
Do While Not IsNumeric(Mid(Selection.Cells(2).Value, xNum2, 1))
xNum2 = xNum2 + 1
Loop
'establish that both selected cells beging with the same letters
txt1 = Left(val1, xNum - 1)
If Left(val2, xNum - 1) < Left(val1, xNum2 - 1) Then
MsgBox "selected values do not begin with the same letters"
End
End If
'establish the rows to insert
val1 = Right(Selection.Cells(1).Value, Len(Selection.Cells(1).Value) - xNum + 1)
val2 = Right(Selection.Cells(2).Value, Len(Selection.Cells(2).Value) - xNum + 1)
'Insert Rows
Selection.Cells(1).Select
For RowNum = val1 + 1 To val2 - 1
ActiveCell.Offset(1, 0).EntireRow.Insert
ActiveCell.Offset(1, 0).Select
ActiveCell.Value = txt1 & RowNum
Next RowNum
End Sub
Bookmarks