- 帖子
- 4901
- 主題
- 44
- 精華
- 24
- 積分
- 4916
- 點名
- 142
- 作業系統
- Windows 7
- 軟體版本
- Office 20xx
- 閱讀權限
- 150
- 性別
- 男
- 來自
- 台北
- 註冊時間
- 2010-4-30
- 最後登錄
- 2026-7-16
                
|
2#
發表於 2011-6-15 22:17
| 只看該作者
- Sub nn()
- Dim Ay()
- With Workbooks.Open(ThisWorkbook.Path & "\999.xls")
- With .ActiveSheet
- For Each a In .Range(.[A1], .[A65536].End(xlUp))
- If IsDate(a) Then
- ar = Array(a.Offset(5).Value, a.Value, a.Offset(1).Value, a.Offset(3).Value)
- ReDim Preserve Ay(s)
- Ay(s) = ar
- s = s + 1
- End If
- Next
- End With
- .Close
- End With
- Sheets("Sheet1").[A2].Resize(s, 4) = Application.Transpose(Application.Transpose(Ay))
- End Sub
複製代碼 |
|