- ©«¤l
- 4901
- ¥DÃD
- 44
- ºëµØ
- 24
- ¿n¤À
- 4916
- ÂI¦W
- 137
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 20xx
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-4-30
- ³Ì«áµn¿ý
- 2025-6-7
               
|
¦^´_ 12# leoman0002
¤£¬O«ÜÀ´¹ïÀ³Ãö«Y¡A´ú¸Õ¬Ý¬Ý®t²§¦bþ?- Sub ex()
- fd = ThisWorkbook.Path & "\"
- fs = Dir(fd & "*.csv")
- Do Until fs = ""
- With Workbooks.Open(fd & fs)
- With .Sheets(1)
- lot = Replace(.[B6].Value, "'", "")
- lin = Replace(Split(lot, "-")(0), Mid(Split(lot, "-")(0), 3, 5), "")
- ps = Split(lot, "-")(1)
- drv = .[D4].Value
- tm = IIf(.[H12] = "Bef", "[Before]", "[After]")
- ts = .[F12].Value
- ar1 = Array(lot, lin, ps)
- ar2 = Array(drv, tm, ts, ts)
- Set ar3 = .[F21:F24]
- Dim ar(24)
- For i = 27 To 34
- For j = 1 To 3
- ar(s) = .Cells(i, j * 2).Value
- s = s + 1
- Next
- Next
- End With
- With ThisWorkbook.Sheets("Test Data")
- Set a = .[A65536].End(xlUp).Offset(1, 0)
- a.Resize(, 3) = ar1
- a.Offset(, 6).Resize(, 4) = ar2
- a.Offset(, 10) = ar3(1, 1)
- a.Offset(, 17) = ar3(2, 1)
- a.Offset(, 18) = ar3(3, 1)
- a.Offset(, 19) = ar3(4, 1)
- a.Offset(, 20).Resize(, 24) = ar
- End With
- .Close 0
- End With
- fs = Dir
- Loop
- End Sub
½Æ»s¥N½X |
|