Option Explicit
Sub AddRowInTableNoVariables()
ThisWorkbook.Worksheets("Sheet1").ListObjects("Table1").ListRows.Add
End Sub
Sub AddRowInTableTableVariable()
Dim tbl As ListObject
Set tbl = ThisWorkbook.Worksheets("Sheet1").ListObjects("Table1")
tbl.ListRows.Add
End Sub
Sub AddRowInTableAllVariables()
Dim wb As Workbook: Set wb = ThisWorkbook
Dim ws As Worksheet: Set ws = wb.Worksheets("Sheet1")
Dim tbl As ListObject: Set tbl = ws.ListObjects("Table1")
tbl.ListRows.Add
End Sub
2条答案
按热度按时间7ajki6be1#
首先可以得到 * 最后一行的行号 *
Last_row
,然后将公式复制到下一个单元格行。bvn4nwqk2#
在表中添加行
密码