Sub addRow()
Dim ws As Worksheet
Set ws = ActiveSheet
Dim tbl As ListObject
Set tbl = ws.ListObjects("Table1") ' Change "Table1" for your table name
'add a row at the end of the table
tbl.ListRows.Add
End Sub
Sub addRow()
Dim lastRow As Long
Dim col As Long
Dim row As Long
Dim lastCol As Long
Dim i As Long
lastRow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).row
Range("A" & lastRow).EntireRow.Offset(1, 0).Insert
col = 5000
row = 1
lastCol = ActiveSheet.Cells(row, col).End(xlToLeft).Column
Range("A" & lastRow, Cells(lastRow, lastCol)).Copy
Range("A" & lastRow + 1).PasteSpecial xlFormats
For i = 1 To lastCol
If Cells(2, i).HasFormula = True Then
Cells(2, i).Select
Selection.AutoFill Destination:=Range(Cells(2, i), Cells(lastRow + 1, i))
End If
Next i
End Sub
Sub robyrux()
With Range("A" & Rows.Count).End(xlUp)
.EntireRow.Resize(2).FillDown
On Error Resume Next
.Offset(1).EntireRow.SpecialCells(xlConstants).ClearContents
On Error GoTo 0
End With
End Sub
Thank you so much! It works!Another optionVBA Code:Sub robyrux() With Range("A" & Rows.Count).End(xlUp) .EntireRow.Resize(2).FillDown On Error Resume Next .Offset(1).EntireRow.SpecialCells(xlConstants).ClearContents On Error GoTo 0 End With End Sub