|
- Sub aa()
- Dim arr, arr1, i As Long, n As Long
- Dim str1 As String, str2 As String, date1 As Date
- arr = Range("D9:M14")
- ReDim arr1(1 To UBound(arr), 1 To UBound(arr, 2) + 3)
- str1 = [E6]
- str2 = [L5]
- date1 = [L6]
- For i = 1 To UBound(arr)
- If arr(i, 1) = "" Then
- With Sheets("军")
- n = .[A65536].End(xlUp).Row + 1
- .Range("A" & n).Resize(UBound(arr1), UBound(arr1, 2)) = arr1
- End With
- MsgBox "数据录入完成"
- Range("D9:M14").ClearContents
- Exit Sub
- Else
- arr1(i, 1) = str1
- arr1(i, 2) = date1
- arr1(i, 3) = str2
- For j = 4 To UBound(arr1, 2)
- arr1(i, j) = arr(i, j - 3)
- Next j
- End If
- Next i
- End Sub
复制代码 |
|