¥Î°j°é§ì¸ê®Æ¶V¶]¶VºC¡A¸Ó¦p¦óÄÀ©ñ°O¾ÐÅé?
- ©«¤l
- 49
- ¥DÃD
- 18
- ºëµØ
- 0
- ¿n¤À
- 154
- ÂI¦W
- 0
- §@·~¨t²Î
- windows
- ³nÅ骩¥»
- XP
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-6-16
- ³Ì«áµn¿ý
- 2024-8-5
|
¥Î°j°é§ì¸ê®Æ¶V¶]¶VºC¡A¸Ó¦p¦óÄÀ©ñ°O¾ÐÅé?
¦U¦ì«e½ú¤j®a¦n,
§Ú¦³Óµ{¦¡¨Ï¥Î°j°é¤Îquerytable.addªº¤è¦¡§ì¨ú¥~³¡¸ê®Æ(§ì§¹·|°õ¦æquerytable.delete)
¨Ã¦b¶×¤J¸ê®Æ«á¥Îworksheets.copyªº¤è¦¡¥t¦s¡A
¦¹®Éµ{¦¡·|¦Û°Ê·s¼W¤@Ó¬¡¶Ã¯¡A«Ý¦sÀÉ«á¦A±N·s¼Wªº¬¡¶Ã¯Ãö³¬
¦ý§Úµo²{¦p¦¹¤@¨Ó¡A¦]¬°¨C¦¸copy¤u§@ªí®É³£·|·s¼W¤@Ó¬¡¶Ã¯
¦pªG§Úªº°j°é¤@¦@n§ì¦n´X¦Ê¦¸ªº¸ê®Æ
¨º´N·|¼W¥[¦n´X¦ÊÓ¬¡¶Ã¯
ÁöµM¤§«á·|Ãö³¬¡A¦ý¤£¾å±o°O¾ÐÅ馳¨S¦³ÄÀ©ñ±¼¡A¦]¬°¬¡¶Ã¯ªº½s¸¹·|¤@ª½¼W¥[¤W¥h
¦Óµ{¦¡¶]ªº³t«×¤]¶V¨Ó¶VºC....@@"
¥i¥H½Ð¦U¦ì«e½úÀ°¦£¸Ñµª¤@¤U¶Ü? ÁÂÁ |
|
|
|
|
|
|
- ©«¤l
- 2035
- ¥DÃD
- 24
- ºëµØ
- 0
- ¿n¤À
- 2031
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- Office2010
- ¾\ŪÅv
- 100
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-3-22
- ³Ì«áµn¿ý
- 2024-2-1
|
¥»©«³Ì«á¥Ñ c_c_lai ©ó 2014-6-7 07:06 ½s¿è
¦U¦ì«e½ú¤j®a¦n,
§Ú¦³Óµ{¦¡¨Ï¥Î°j°é¤Îquerytable.addªº¤è¦¡§ì¨ú¥~³¡¸ê®Æ(§ì§¹·|°õ¦æquerytable.delete) ...
sasho µoªí©ó 2014-6-7 01:53
¨Ì§A´yz§@·~¹Lµ{¡A¶Õ¥²·|·U¨Ó·UºC¡AEXCEL ¥»¨¦b°õ¦æ®É·|¥t¥~²£¥Í¤@¤u§@¯¸¼È¦sÀÉ¡A
¥¦·|ÀH®É°ÊºA¦a±N§A©Ò¦³²§°Êª¬ºA¬ö¿ý©ó¦¹Àɮפº¡A¥¦©Ó¾á¤F©Ò¦³Åç¹ï¡BÅÜ°Ê¡B§R°£¡B
·s¼W¥H¤Î°O¾ÐÅ骺¯Ó¥Î¡A©óÀɮפ£Â_¼W¤j®É¡A¨ät²ü¥ç¸òÀH¤§¼W¤j¡C
¸Ñ¨M¤èªk¥i±N¶·¤£Â_¼W¥[ªºÀɮצs©ó¥t¤@¤u§@ÀÉ¡A¤£¥Î®É«hÀH®É±N¥¦Ãö³¬¡A¦p¦¹§@·~
¦A¨Óµû¦ô¦¨®Ä¡C´N¦p¤W GBKEE ª©¤j©Ò®i¥Üªºµ{¦¡½X¤@¼Ë¡A³B²z§¹²¦§YÀH¤â±N¥¦Ãö³¬¡C |
|
|
|
|
|
|
- ©«¤l
- 49
- ¥DÃD
- 18
- ºëµØ
- 0
- ¿n¤À
- 154
- ÂI¦W
- 0
- §@·~¨t²Î
- windows
- ³nÅ骩¥»
- XP
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-6-16
- ³Ì«áµn¿ý
- 2024-8-5
|
¥»©«³Ì«á¥Ñ sasho ©ó 2014-6-16 18:16 ½s¿è
¦^´_ 2# GBKEE
·PÁÂG¤jªº«üÂI¡A¦ý¥i¯à§Úªí¹Fªº¤£¬O«Ü²M·¡¡A©Ò¥HÅý¤j®a»~·|§Úªº°ÝÃD¤F
¸òG¤j©Ò¥Ü½dªº¤@¼Ë¡Aµ{¦¡¦A¶×¤Jºô¶¸ê®Æ«á³£·|¥t¦s¦¨¤@ÓCSVÀɮרÃÃö³¬¡A
¦P®É¡A±N©Ò·s¼Wªºquerytable delete±¼¡Aµ{¦¡½X¦p¤U¡G- Sub ¨ú±o¸ê®Æ(strURL As String, Table As String)
- Dim xlSheet As Excel.Worksheet
- Set xlSheet = Sheets("Temp")
- Do
- Application.DisplayAlerts = False
- With xlSheet.QueryTables.Add("URL;" & strURL, xlSheet.Cells(1, 1))
- .WebFormatting = xlWebFormattingNone
- .WebSelectionType = xlSpecifiedTables
- .WebTables = Table
- .BackgroundQuery = False
- On Error Resume Next
- Do
- Err.Clear
- .Refresh 0
-
- If Err.Number Then
- Application.Wait Now + TimeValue("00:00:01")
- End If
- Loop Until Err.Number = 0
-
- .Delete
- 'If Err.Number <> 0 Then Err.Clear: MsgBox Err.Number '³Q§K¸ê®Æ§ì¨ú¤£¦¨¥\,¦ÓÅã¥Ü°T®§
-
- On Error GoTo 0
- End With
- If Err.Number = 0 Then
- Application.DisplayAlerts = True
- Exit Sub
- End If
- Loop
- Àx¦sCSV DownloadDate,id
- End Sub
- Sub Àx¦sCSV(SaveDate As String, CSVname As String)
-
- Dim TestObj As Object
- Dim CSVfile As String, CSVfolder As String
- Dim TestFolder As Boolean
-
- FilePath = "D:\TSE\"
- CSVfolder = FilePath & SaveDate & "\"
- CSVfile = CSVfolder & CSVname & "_" & SaveDate & ".csv"
- 'Debug.Print CSVfile
-
- Set TestObj = CreateObject("Scripting.FileSystemObject")
- TestFolder = TestObj.FolderExists(CSVfolder)
- If TestFolder = False Then TestObj.CreateFolder (CSVfolder)
- On Error Resume Next
- Kill CSVfile
- On Error GoTo 0
- Worksheets(Tempname).Copy
- Application.DisplayAlerts = False
- With ActiveWorkbook
- .SaveAs FileName:=CSVfile, FileFormat:=xlCSV
- .Close 0
- End With
- Application.DisplayAlerts = True
-
- End Sub
½Æ»s¥N½X §Úªº°ÝÃD¬O¦b©ó¡A¥Ñ©ó§Ú¥Î°j°é¤@¦@n§ì´X¦Êµ§ªº¸ê®Æ
§Ú±qÀx¦s¤U¨ÓªºÀɮ׳̫áÅܰʮɶ¡Æ[¹î¡Aµo²{¤@¶}©l¥i¯à¤@¬íÄÁ¥i¥H§ì¤¨ì¤»ÓÀÉ®×
¦ý¨ì«á±¡A¥i¯à¤@¬íÄÁ´N¥u¯à§ì¨âÓÀɮסAÀɮפj¤p³£®t¤£¦h
¤@ª½¤£ª¾¹D¬°¤°»ò³t«×·|¶V¨Ó¶VºC¡A¨C§ì§¹¤@µ§ÀÉ®×´N°õ¦æ¤@¦¸ doevents
©Ò¥HÀ³¸Ó¤£¦Ü©ó³y¦¨CPU¸ê·½³Q¦Y¥ú
°ß¤@¯à·Q¨ìªº´N¬O¡A¨C¦¸¥t¦s¤@ÓÀɮסA´N·|·s¶}¤@Ó¬¡¶Ã¯
¤ñ¤è»¡¡A¬¡¶Ã¯1¡B¬¡¶Ã¯2¡B¬¡¶Ã¯3....¨ì³Ì«áªº¬¡¶Ã¯999
ÁöµM§â¸ê®Æ½Æ»s¹L¥h«á¡B¥t¦s·sÀÉ«á¸Ó¬¡¶Ã¯´N·|Ãö³¬¡A¦ýEXCEL¦n¹³ÁÙ¬O·|¥e¥Î¨ì°O¾ÐÅé¸ê·½
¬O¤£¬O¦]¬°³o¼Ë¤~¾ÉP³t«×¶V¨Ó¶VºC©O?
ÁÙ¬O»¡¡A¬O¦]¬°§Ú½Æ»sªº¤è¦¡¤£¥¿½T¤~·|¾ÉP°O¾ÐÅé¼W¥[ªº©O?
G¤j¸ò§Úªº®t§O¦b©ó¡A¶×¤J¸ê®Æ«áG¤j¬Oworkbook.addµM«á½Æ»s¶×¤Jªºrange
¦Ó§Ú«h¬Oª½±µ±N¾ãÓworksheet copy
¤£¾å±o³o¨âªÌªº¤è¦¡¦³®t¶Ü
ÁÂÁ¦U¦ì«e½ú«üÂI m(_ _)m |
|
|
|
|
|
|
- ©«¤l
- 1018
- ¥DÃD
- 15
- ºëµØ
- 0
- ¿n¤À
- 1058
- ÂI¦W
- 0
- §@·~¨t²Î
- win7 32bit
- ³nÅ骩¥»
- Office 2016 64-bit
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ®ç¶é
- µù¥U®É¶¡
- 2012-5-9
- ³Ì«áµn¿ý
- 2022-9-28
|
¦^´_ 4# sasho
§Ú·|¥ý§â©I¥s§ï¬°- t = timer
- Àx¦sCSV DownloadDate,id
- debug.print timer-t
½Æ»s¥N½X ¥ýÆ[¹î½T»{ ®É¶¡Åܪøªº¦a¤è ¬O¦b ¦sÀɳo³¡¤À¡C |
|
|
|
|
|
|
- ©«¤l
- 49
- ¥DÃD
- 18
- ºëµØ
- 0
- ¿n¤À
- 154
- ÂI¦W
- 0
- §@·~¨t²Î
- windows
- ³nÅ骩¥»
- XP
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-6-16
- ³Ì«áµn¿ý
- 2024-8-5
|
¦^´_ 5# stillfish00
®É¶¡Åܪøªº³¡¤À¡AÀ³¸Ó¬O¦b¶×¤Jºô¶¸ê®Æ©Òªáªº®É¶¡
¤@¶}©l¶×¤J«Ü¶¶¡A¦ý¶V¨ì«á±´N¶V¥d¡A¤£ª¾¹D¬O¤°»òì¦]
¦P®É§Ú¦³Æ[¹îEXCEL¦b¤u§@ºÞ²zû¤¤¥e¥Îªº°O¾ÐÅé®e¶q
±qµ{¦¡°õ¦æ«e¨ìµ{¦¡°õ¦æ«á¡A¾ãÓ°O¾ÐÅé¼W¥[¤F¤£¤Ö
¤@¼Ë¤]¬O¤£ª¾¹Dì¦]
Àµ½Ð¦U¦ì¤j¤j¸Ñ±Ï¤@¤U |
|
|
|
|
|
|
- ©«¤l
- 1018
- ¥DÃD
- 15
- ºëµØ
- 0
- ¿n¤À
- 1058
- ÂI¦W
- 0
- §@·~¨t²Î
- win7 32bit
- ³nÅ骩¥»
- Office 2016 64-bit
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ®ç¶é
- µù¥U®É¶¡
- 2012-5-9
- ³Ì«áµn¿ý
- 2022-9-28
|
¦^´_ 7# GBKEE
Hi ª©¤j¡A
§Ú¤£¾å±o¬O¤£¬OEXCELª©¥»®t²§¡A
§Ú¦bExcel2010¤¤¡A§R°£QueryTableª«¥ó´N·|ª½±µ§R°£Names¤¤ªº¶µ¥Ø¤F¡C |
|
|
|
|
|
|
- ©«¤l
- 1018
- ¥DÃD
- 15
- ºëµØ
- 0
- ¿n¤À
- 1058
- ÂI¦W
- 0
- §@·~¨t²Î
- win7 32bit
- ³nÅ骩¥»
- Office 2016 64-bit
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ®ç¶é
- µù¥U®É¶¡
- 2012-5-9
- ³Ì«áµn¿ý
- 2022-9-28
|
¥»©«³Ì«á¥Ñ stillfish00 ©ó 2014-6-17 14:09 ½s¿è
¦^´_ 9# GBKEE
QueryTables.Delete ¥u·|§R°£³s½u©M©w¸qªº¦WºÙ¡A¤£·|§R°£¨ú±oªº¸ê®Æ
¦Ó¼Ó¥D¥Î°j°é°õ¦æ¦hµ§®É¸ê®Æ·|¤@ª½©¹¥k²Ö¿n¼W¥[
³o¤]³\¥i¥H§ïRefreshStyle¬°xlOverwriteCells¨Ó¨¾¤î(¹w³]¬OxlInsertDeleteCells)
¹³³o¼Ë- Sub Ex()
- Dim i As Integer, Rng As Range
- With ActiveSheet
- For i = 3 To 7 Step 2
- With .QueryTables.Add("URL;http://forum.twbts.com/thread-635-1-1.html", .Cells(1, 1))
- .WebSelectionType = xlSpecifiedTables
- .WebFormatting = xlWebFormattingNone
- .WebTables = i & ""
- .WebPreFormattedTextToColumns = True
- .WebConsecutiveDelimitersAsOne = True
- .WebSingleBlockTextImport = False
- .WebDisableDateRecognition = False
- .WebDisableRedirections = False
-
- .RefreshStyle = xlOverwriteCells
- .Refresh BackgroundQuery:=False
- Wb_Save .ResultRange, i
-
- .Delete
- End With
- Next
- End With
- End Sub
½Æ»s¥N½X |
|
|
|
|
|
|
- ©«¤l
- 49
- ¥DÃD
- 18
- ºëµØ
- 0
- ¿n¤À
- 154
- ÂI¦W
- 0
- §@·~¨t²Î
- windows
- ³nÅ骩¥»
- XP
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-6-16
- ³Ì«áµn¿ý
- 2024-8-5
|
¦^´_ 8# stillfish00
§Ú¨Ï¥Îªº¬OEXCEL 2010¡A°õ¦æQueryTables.delete¨Ã¤£·|±N¶×¤J¸ê®Æ§R°£¡A¥u·|§â³s½u§R°£¦Ó¤w
¥t¥~¡A§Ú¦b¥t¦s¶×¤J¸ê®Æ«á¡A¤]·|¦b°õ¦æworksheets.cells.delete¡A©Ò¥H¸ê®Æ¬O¤£·|¦V¥k²Ö¿nªº
·PÁÂ |
|
|
|
|
|
|