ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ¶×¤J¥~³¡¸ê®Æ°ÝÃD

[µo°Ý] ¶×¤J¥~³¡¸ê®Æ°ÝÃD

½Ð°Ý¦U¦ì¤j¤j­n¦p¦ó½T»{¥Ø«e©Ò¦³ªº¤u§@ªí¤w¸g§ó·s§¹²¦¡AÄ´¦p:¤u§@ªí1¥¿¦b°õ¦æ¥~³¡§ó·s¡A¦Ó§Ú­n«ç»ò¦bµ{¦¡½X¤¤½T»{"¤u§@ªí1ªº¥~³¡§ó·sµ{§Ç¬O§_¤w¸gµ²§ô"¡C

¤@§Z¤T¥|¡BÅå¨ìåF¥N»x

TOP

¤j¤j§Aªºµ{¦¡§Ú¬Ý±oÀ´¦ý¬O§Ú¤£ª¾¹D¸Ó«ç»òµ²¦X¦Û¤vªºµ{¦¡½X
³o¬O§Úªºµ{¦¡½X:

Sub §ó·s¥~³¡¸ê®Æ()
'
' §ó·s¥~³¡¸ê®Æ Macro
' Queen ¦b 2010/10/7 ¿ý»sªº¥¨¶°
'

'
    Application.ScreenUpdating = False
    On Error Resume Next
    Sheets("·l¯qªí").Select
    Range("A1").Select
    Selection.QueryTable.Refresh BackgroundQuery:=False
    Sheets("¸ê²£­t¶Åªí").Select
    Range("A1").Select
    Selection.QueryTable.Refresh BackgroundQuery:=False
    Sheets("°ò¥»¸ê®Æ").Select
    Range("A1").Select
    Selection.QueryTable.Refresh BackgroundQuery:=False
    Sheets("ªÑ»ù").Select
    Range("A1").Select
    Selection.QueryTable.Refresh BackgroundQuery:=False
    Sheets("¸ê®Æ").Select
    Application.ScreenUpdating = True
End Sub

TOP

¦^´_ 3# xisun2002
  1. Sub Ex()
  2.     Dim Sh As Worksheet, Query As QueryTable
  3.     For Each Sh In ThisWorkbook.Worksheets
  4.         For Each Query In Sh.QueryTables
  5.             Query.Refresh 0  'BackgroundQuery:=False
  6.         Next
  7.     Next
  8. End Sub
½Æ»s¥N½X

TOP

¥»©«³Ì«á¥Ñ ¨F©Ôªo ©ó 2010-11-26 16:45 ½s¿è

¤@­Óª«¥óÃþ§O¡B¤@­Ó¼Ò²Õ
¶K¤Wµ{¦¡½X¤§«á±o­«·s¶}±ÒÀÉ®×
  1. 'ª«¥óÃþ§O¼Ò²Õ QytCls ªºµ{¦¡½X
  2. Public WithEvents qyt As QueryTable
  3. Public qname As String
  4. Private Sub qyt_AfterRefresh(ByVal Success As Boolean)
  5.   MsgBox qname & " §ó·sµ²§ô¡I"
  6. End Sub
  7. '¼Ò²Õ Module1 ªºµ{¦¡½X
  8. Dim qyts() As New QytCls
  9. Private Sub auto_open()
  10.   Dim n As Integer
  11.   Dim sh As Worksheet
  12.   '²Î­p¥»¬¡­¶Ã¯¦@¦³´X­Ó¬d¸ßª«¥ó¡I
  13.   For Each sh In ThisWorkbook.Worksheets
  14.     n = n + sh.QueryTables.Count
  15.   Next
  16.   ReDim qyts(1 To n) As New QytCls
  17.   Dim i As Integer
  18.   Dim qyt As QueryTable
  19.   For Each sh In ThisWorkbook.Worksheets
  20.     For Each qyt In sh.QueryTables
  21.       Set qyts(i + 1).qyt = qyt
  22.       qyts(i + 1).qname = sh.Name & " ªº¬d¸ß " & qyt.Name
  23.       i = i + 1
  24.     Next qyt
  25.   Next sh
  26. End Sub
½Æ»s¥N½X
ªþ¤W¤W­±µ{¦¡½X©Ò»s§@ªº½d¨Ò¡I

Book1.zip (27.02 KB)

¤@§Z¤T¥|¡BÅå¨ìåF¥N»x

TOP

·PÁ¦U¦ì¤j¤jªº¤j¤OÀ°§U...3Q

TOP

        ÀR«ä¦Û¦b : ¥¬¬I¦p¼½ºØ¡A¥HÅw³ß¤ß´þ¼íºØ¤l¡A¤~·|µoªÞ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD