- ©«¤l
- 1
- ¥DÃD
- 1
- ºëµØ
- 0
- ¿n¤À
- 2
- ÂI¦W
- 0
- §@·~¨t²Î
- win7
- ³nÅ骩¥»
- SP1
- ¾\ŪÅv
- 10
- µù¥U®É¶¡
- 2015-5-14
- ³Ì«áµn¿ý
- 2015-10-9
|
[µo°Ý] ½Ð±Ð¶}±ÒÀɮפ§ÀɦW¦p¦ó¨Ì§Ç¶K¨ì¤À¶
¥Ø«e¥¨¶°¤w¥i¥H±N©Òn¶}ªº¸ê®Æ§¨¤ºÀɮ׶}±Ò¿ï¾Ü©Ò»Ýªºrange¨Ã¶K¤W·s¼Wªº¤À¶ ,¦ý±ý¥[¤W¶}±ÒªºÀɦWn¥[¨ì ®Ø¿ïªºrange «e±¤@Äæ. «ç»ò´ú¸Õ³£¥Î¤£¥X¨Ó....
½Ð±Ð¦U¦ì¥ý½å, ¦p¦ó§Q¥Î°j°é©ÎªÌ¨º¤@ºØ¼gªk¥i¥H¹F¨ì¦¹¥Øªº. ·Ð½Ð«ü±Ð.ÁÂÁÂ
Workbooks("Get_report.xlsm").Activate '½T»{¥¨¶°Àɮ׬O¥¿¦b°õ¦æ¤¤
Sheets("Address").Select
For i = 2 To 65536
Sheets("Address").Select
Sheets("Address").Activate
If Cells(i, 1).Value = "" Then Exit For
ToolID = Cells(i, 1).Value
'½T»{Àɮ׬O§_¦s¦b
sPath$ = "D:\temp\Lot_Report\" & ToolID
sDir$ = Dir(sPath, vbDirectory)
If sDir = "" Then MsgBox " Path " & sDir & " Not Found"
sDir$ = Dir(sPath & "\*.*")
'·s¼W¾÷¥x¶¦¸
ActiveWorkbook.Sheets.Add After:=Worksheets(Worksheets.Count)
ActiveSheet.Name = ToolID
Do Until sDir = ""
'¶}Àɸô®|
Workbooks.OpenText fileName:="D:\temp\Lot_Report\" & ToolID & "\" & sDir, Origin:=xlWindows _
, StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, _
Tab:=False, Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar:="|", FieldInfo:=Array(1, 1), TrailingMinusNumbers:=True
'·j´MÃöÁä¦r
Cells.Find(What:="DYNAMIC ", After:=ActiveCell, LookIn:=xlFormulas, lookat:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, MatchByte:=False, SearchFormat:=False).Activate
'¿ï¾Ü»Ýnªº¸ê®Æ¨Ã½Æ»s¨ì¾÷¥x¶±
ActiveCell.Range("A1:J29").Select
Selection.Copy
Workbooks("Get_report.xlsm").Activate
Sheets(ToolID).Select
Sheets(ToolID).Activate
EndRow = ActiveSheet.UsedRange.Rows.Count + 1 '©Ò¦³¨Ï¥Î¤¤ªº¦C¼Æ+1
Rows(EndRow).PasteSpecial Paste:=xlPasteValues '¥Ø«e¨Ï¥Î¤¤ªº¤À¶,ªº³Ì¤U¤èªÅ¥Õ¦C¶K¤WÈ
Application.DisplayAlerts = False
Workbooks(sDir).Close 'Ãö³¬¥t¦s·sÀɪºÀÉ®×
sDir = Dir() 'Ū¨ú¤U¤@ÓÀÉ®×
Loop
Sheets(ToolID).Select
Sheets(ToolID).Activate
Range("A1").Select
Next |
|