- ©«¤l
- 94
- ¥DÃD
- 28
- ºëµØ
- 0
- ¿n¤À
- 145
- ÂI¦W
- 0
- §@·~¨t²Î
- windows
- ³nÅ骩¥»
- office 2007
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2011-9-22
- ³Ì«áµn¿ý
- 2021-10-18
|
¦^´_ 2# luhpro
±z¦n:
¤£ª¾¹D¦p¦ó¥[¤J±zµ¹§Úªºµ{¦¡½X¡A¦ý¬O§ó·sªº®ÉÔ·|¦A.Refresh³o¤@¦æ¥X²{¿ù»~¡C
¥i¥H¦A½Ð¦h«ü±Ð¤@¨Ç¶Ü? ÁÂÁ¡C
Sub ¤U¸ü°ò¥»¸ê®Æ()
Range("P" & 23).Formula = "§ó·s¶}©l..." '.§ï
Application.ScreenUpdating = False
Sheets("DDE").Select
x = Application.WorksheetFunction.CountA(Range("A:A")) 'Äæ¦ì¦³È½d³òpºâ
With ThisWorkbook
For Each a In .Sheets("DDE").Range("A" & 1418, "A" & x - 1).SpecialCells(xlCellTypeConstants).Offset(1) '³]©w½d³ò '==========n´î1============
§ó·s¸ê®Æ a '°õ¦æ12Àɮקó·s
Workbooks("·ÀIµû¦ô.xlsx").Sheets(Array("IS", "ISQ", "BS", "BSQ", "BASIC", "YrPrice", "FR", "CFS", "ISQT")).Copy '½Æ»s¤u§@ªí
ActiveWorkbook.SaveAs ThisWorkbook.Path & "\Base\" & CStr(a) & ".xlsx" '¥t¦s·sÀÉ
ÃöÀÉ
Next
End With
Sheets("DDE").Select
Range("P" & 23).Formula = "§ó·sµ²§ô" '.§ï
Application.ScreenUpdating = True
End Sub
Sub §ó·s¸ê®Æ(a)
Dim Sh As Worksheet, MyURL$, MyQy As QueryTable
With ThisWorkbook
fd = .Path & "\°ò¥»±\·ÀIµû¦ô\"
fs = Dir(fd & "*.xlsx")
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 |
|