|
发表于 2013-4-11 15:14
|
显示全部楼层
本楼为最佳答案
- Sub 提取日期()
- Dim i As Long
- Dim lLastrow As Long
- Dim j As Long, arr
- Dim result(), lCount As Long
- Dim sht As Worksheet
- ReDim result(1 To 1)
- Worksheets("总表").Activate
- For Each sht In Worksheets
- If sht.Name <> "总表" Then
- With sht
-
- lLastrow = .Cells(Rows.Count, "e").End(xlUp).Row
- arr = .Range("d3:i" & lLastrow)
- For j = LBound(arr) To UBound(arr)
- If arr(j, 6) > 0 And Len(arr(j, 1)) > 0 Then
- lCount = lCount + 1
- ReDim Preserve result(1 To lCount)
- result(lCount) = arr(j, 1)
- End If
- Next
- End With
- End If
- Next
- If lCount > 0 Then
- Cells(Cells(Rows.Count, 1).End(xlUp).Row + 1, 1).Resize(lCount) = WorksheetFunction.Transpose(result)
- End If
- End Sub
复制代码 |
|