- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¦^´_ 1# EGBT
¸Õ¸Õ¬Ý
ThisWorkbook¼Ò²Õªºµ{¦¡½X- Option Explicit
- Public MSG As String
- '¦bWorkbook¥ô¤@¤u§@ªí¤W«ö¥kÁä "ªº¹w³]¨Æ¥ó
- Private Sub Workbook_SheetBeforeRightClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
- Cancel = True '¤£Åã¥Ü¤u§@ªí¤W«ö¤U¥kÁä©ÒÅã¥Ü¥\¯àªí
- EX
- End Sub
- Private Sub EX() ' §ó·s¥~³¡¬d¸ßªºµ{¦¡
- Dim Sh As Worksheet, q As QueryTable
- Dim Sh_Table As New Class1 ' Class1 ª«¥óÃþ§O¼Ò²Õªº¦WºÙ
- MSG = ""
- For Each Sh In Sheets(Array("Sheet1", "Sheet2", "Sheet3")) '°²¦p§Ú¦³3Ó¤u§@ªí
- 'For Each Sh In Sheets '©Ò¦³¤u§@ªí
- If Sh.QueryTables.Count > 0 Then
- For Each q In Sh.QueryTables
- Set Sh_Table.XQueryTable = q '¬d¸ßªí ³]¬° ª«¥óÃþ§Oªºª«¥ó
- q.Refresh False
- Next
- End If
- Next
- If MSG <> "" Then
- MsgBox MSG
- Else
- MsgBox Me.Name & " ¨S¦³¥~³¡¬d¸ß"
- End If
- End Sub
½Æ»s¥N½X ª«¥óÃþ§O¼Ò²Õ[Class1]ªºµ{¦¡½X- Option Explicit
- Public WithEvents XQueryTable As QueryTable
- Private Sub XQueryTable_AfterRefresh(ByVal Success As Boolean)
- ThisWorkbook.MSG = ThisWorkbook.MSG & IIf(ThisWorkbook.MSG <> "", vbLf, "") & XQueryTable.Parent.Name & "-" & XQueryTable.Name & "§ó·s " & IIf(Success, "¦¨¥\", "¥¢±Ñ")
- End Sub
½Æ»s¥N½X |
|