- ©«¤l
- 4901
- ¥DÃD
- 44
- ºëµØ
- 24
- ¿n¤À
- 4916
- ÂI¦W
- 239
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 20xx
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-4-30
- ³Ì«áµn¿ý
- 2024-11-4
|
¥»©«³Ì«á¥Ñ Hsieh ©ó 2011-10-3 22:53 ½s¿è
¦^´_ 5# spermbank
§Ú¤£µ½©ó¯}¸Ñ
¦ý¨Ì§A±Ôz©Î³\¥i¸Õ¸Õ¦bӪѰò¥»±¤ÀªR.xls¤@¯ë¼Ò²Õ
°õ¦æ§ó·s¥Dµ{§Ç¸Õ¸Õ- Sub §ó·s¥Dµ{§Ç()
- With ThisWorkbook
- For Each a In .Sheets(1).[A2:A1341] '¨CÓ¥N¸¹´`Àô
- §ó·s¸ê®Æ a '°õ¦æ12Àɮקó·s
- Workbooks("·ÀIµû¦ô.xls").Sheets(Array("IS", "ISQ", "BS", "BSQ", "BASIC", "YrPrice", "FR", "CFS", "ISQT")).Copy '½Æ»s¤u§@ªí
- ActiveWorkbook.SaveAs ThisWorkbook.Path & "\" & CStr(a) & ".xls" '¥t¦s·sÀÉ
- Workbooks("Àç·~¦¬¤JÅÜ°Ê.xls").Sheets("Revenue").Copy Before:=Workbooks(CStr(a) & ".xls").Sheets(1) '½Æ»s¤u§@ªí
- ÃöÀÉ
- Next
- End With
- End Sub
- Sub §ó·s¸ê®Æ(a)
- Dim Sh As Worksheet, MyURL$, MyQy As QueryTable
- With ThisWorkbook
- fd = .Path & "\°ò¥»±\"
- fs = Dir(fd & "*.xls")
- Do Until fs = ""
- With Workbooks.Open(fd & fs)
- For Each Sh In .Sheets
- With Sh
- If .QueryTables.Count > 0 Then
- Set MyQy = .QueryTables(1)
- With .QueryTables(1)
- MyURL = .Connection
- If InStr(MyURL, "StockID") > 0 Then
- k = Val(Split(MyURL, "=")(UBound(Split(MyURL, "="))))
- Else
- k = Val(Split(MyURL, "_")(1))
- End If
- MyURL = Replace(MyURL, k, a)
- .Connection = MyURL '§ó§ï¬d¸ß
- .BackgroundQuery = False '¹õ«e§ó·s
- .Refresh '§ó·s
- End With
- End If
- End With
- Next
- End With
- fs = Dir()
- Loop
- End With
- End Sub
- Sub ÃöÀÉ()
- For Each w In Windows
- If w.Caption <> ThisWorkbook.Name Then w.Close 1
- Next
- End Sub
½Æ»s¥N½X |
|