- ©«¤l
- 1572
- ¥DÃD
- 16
- ºëµØ
- 2
- ¿n¤À
- 1521
- ÂI¦W
- 0
- §@·~¨t²Î
- xp
- ³nÅ骩¥»
- office 2003
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2016-1-13
|
¨Ì§A²{¦³¥N½X¡A¥[¤W´`Àô´N¦æ¤F¡C
¦¹¨Ò¨ú±o¤µ¦~ªº¸ê®Æ¡G- Sub Macro1()
- d = DateValue("2011/10/17")
- i = 3
- Do
- dt = Application.Text(d, "yyyy/mm/dd")
- Set s = Sheet2
- s.UsedRange.Clear
- With s.QueryTables.Add(Connection:= _
- "URL;http://www.trademag.org.tw/ExchangeRate.asp?vdate=" & dt, _
- Destination:=s.Range("$A$1"))
- .Name = "17"
- .FieldNames = True
- .RowNumbers = False
- .FillAdjacentFormulas = False
- .PreserveFormatting = True
- .RefreshOnFileOpen = False
- .BackgroundQuery = True
- .RefreshStyle = xlInsertDeleteCells
- .SavePassword = False
- .SaveData = True
- .AdjustColumnWidth = True
- .RefreshPeriod = 0
- .WebSelectionType = xlSpecifiedTables
- .WebFormatting = xlWebFormattingNone
- .WebTables = "2"
- .WebPreFormattedTextToColumns = True
- .WebConsecutiveDelimitersAsOne = True
- .WebSingleBlockTextImport = False
- .WebDisableDateRecognition = False
- .WebDisableRedirections = False
- .Refresh BackgroundQuery:=False
- End With
- With Sheet1
- For j = s.[iv3].End(1).Column To 3 Step -1
- a = s.Cells(3, j).Resize(41, 1).Value
- .Cells(i, 2) = s.Cells(1, j)
- .Cells(i, 3).Resize(1, 41) = Application.Transpose(a)
- i = i + 1
- Next
- End With
- d = d - 7
- Loop Until Year(d) < 2011
- End Sub
½Æ»s¥N½X |
|