- ©«¤l
- 192
- ¥DÃD
- 15
- ºëµØ
- 0
- ¿n¤À
- 194
- ÂI¦W
- 0
- §@·~¨t²Î
- windows
- ³nÅ骩¥»
- office2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¤k
- µù¥U®É¶¡
- 2016-9-22
- ³Ì«áµn¿ý
- 2020-8-28
|
½Ð°Ý¥H¤U³o²Õµ{¦¡½X
¬°¦ó§Úק蠟«á¤@ª½¼g¦b¦P¤@¦æ¡A¤£·|©¹¤U¤@¦æ¼g¤J¤F
¨Ï¥Î¤èªk¬O: ¶}±Ò"¶×¥X"Excel -> ¸Ì±ÂI¿ï«ö¶s"¶×¥X"
´N·|°õ¦æ¸Ì±ªºVBA¤F
VBA·|¥h§ä¥sRawdataªº¸ê®Æ§¨->¸Ì±ªºEXCEL¤À§O¥´¶}->¨ú¸Ì±§ÚnªºÄæ¦ì¸ê®Æ ->¤@ª½¨ì³Ì«á¤@ÓEXCEL- Sub TT()
- Dim Mypa$, workName$, brr(1), rr, br
- Const sWm As String = "\Rawdata\"
- t = Timer
- Mypa = ThisWorkbook.Path & sWm
- workName = Dir(Mypa & "*.xls")
- Sheet1.UsedRange.Offset(1).ClearContents
- Application.ScreenUpdating = False
- Do Until workName = ""
- With GetObject(Mypa & workName)
- n = n + 1
- With .Sheets("Data")
- brr(0) = .Range("a8").Resize(1, 21)
- brr(1) = .Range("b19").Resize(1, 20)
- End With
- .Close False
- End With
- rr = brr(0): br = brr(1)
- With Sheet1
- i = .Cells(Rows.Count, 1).End(3).Row + 1
- .Range("c" & i).Resize(1, 21) = rr
- .Range("x" & i).Resize(1, 20) = br
- End With
- Erase brr()
- workName = Dir
- Loop
- Application.ScreenUpdating = True
- MsgBox "¦@ªá" & Format(Timer - t, "0.000") & "¬í" _
- & Chr(10) & "§ä¨ì " & n & "µ§¸ê®Æ", vbOKCancel + vbInformation
- End Sub
½Æ»s¥N½X À³¸Ón³o¼Ë§e²{
¦Ó¤£¬O¤@ª½¦b¦P¤@¦æ§e²{...(·íµM³Ì«á¥u¦³³Ì«á§ä¨ìªº¤@µ§ªºµ²ªG)
§Ú¼g¤Jªº¦a¤è¦b³o¸Ì- With Sheet1
- i = .Cells(Rows.Count, 1).End(3).Row + 1
- .Range("c" & i).Resize(1, 21) = rr
- .Range("x" & i).Resize(1, 20) = br
- End With
½Æ»s¥N½X
TEST.rar (155.66 KB)
|
|