View Single Post
 
Old 04-18-2024, 02:45 AM
vivka vivka is offline Windows 7 64bit Office 2016
Expert
 
Join Date: Jul 2023
Posts: 302
vivka is on a distinguished road
Default

Hi, Capitala! The code is quite simple:
Code:
Sub Tbl_Add_Rows()
'In the selected tbl, insert a row after each odd row.

Dim LastRow As Integer
    Application.ScreenUpdating = False
    LastRow = selection.Tables(1).rows.count
    If LastRow Mod 2 = 0 Then
        LastRow = LastRow
    Else: LastRow = LastRow - 1
    End If
    For i = LastRow To 2 Step -2
        selection.Tables(1).rows(i).Select
        With selection.Tables(1).rows(i)
            selection.InsertRowsAbove 1
        End With
    Next i
Application.ScreenUpdating = True
End Sub
Reply With Quote