|
Sub WbInput()
Dim wb As String, xrow As Integer, arr '定义 arr 变量的类型是Variant'
wb = "E:\1_temp\excel VBA\employees.xls"
Workbooks.Open (wb)
With ActiveWorkbook.Worksheets(1)
xrow = .Range("A1").CurrentRegion.Rows.Count + 1 '.Count 获取行号'
arr = Array(xrow - 1, "Arye", "Female", #7/8/1987#, "2010")
.Cells(xrow, 1).Resize(1, 6) = arr
End With
ActiveWorkbook.Close savechanges:=True
End Sub
|
|