这是我的代码:
xlWorkSheet = CType(xlWorkBook.Sheets(ComboBox1.Text), Excel.Worksheet)
xlWorkSheet.Activate()
xlApp.Visible = True
Dim j As Integer
Dim lastrow As Integer
Dim lastcol As Integer
With xlWorkSheet
.Select()
j = xlApp.Cells.SpecialCells(2).Column
lastrow=xlApp.Cells.SpecialCells(2).Rows.End(XlDirection.xlDown).Row
lastcol = xlApp.Cells.SpecialCells(2).Columns.End(XlDirection.xlToRight).Column
For thiscol = j To lastcol
.Cells(lastrow + 1, thiscol).Value = _
xlApp.Sum(.Range(.Cells(1, thiscol), .Cells(lastrow, thiscol)))
Next
End With
我想在表格的末尾添加“sum”这个词 当我找到表的末尾时,我插入“sum”一词
答案 0 :(得分:0)
在next', and before
结束后,添加一行,如:
.cells(lastRow + 2, 1).value = "Somme"
这将是" Somme"在第一列中的最后一行数据之后。