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

[µo°Ý] ¦p¦ó¨ú®ø¥t¦s·sÀɪº¥\¯à

[µo°Ý] ¦p¦ó¨ú®ø¥t¦s·sÀɪº¥\¯à

dear

½Ð°Ý¦p¦ó¨ú®ø¥t¦s·sÀɪº¥\¯à
EXCEL ª©¥» 2007
ºô¸ô¤Wª¦¹L¤@¨Ç¤å,  ¦ü¥G ·sÂÂexcelªºcode·|¤£¦P!?

DEAR SIR
  ¤§«e¬ãŪ«e½ú¤§¤j§@ ¤Þ¥Î»¡©ú¦p¤U
1.¥ý§ì ID
  Sub Id()
Sheet1.[A1:IV65536].ClearContents
For Each cmd In CommandBars
Cells(i + j + 2, 1) = cmd.Index
Cells(i + j + 2, 2) = cmd.Name
Cells(i + j + 2, 3) = cmd.Position
Cells(i + j + 2, 4) = cmd.Type
For Each ctl In CommandBars(cmd.Name).Controls
    Cells(i + j + 2, 5) = ctl.Id
    Cells(i + j + 2, 6) = ctl.Caption
    j = j + 1
Next ctl
i = i + 1
Next
End Sub

2.¨Ì»Ý¨D°õ¦æ ÁôÂà ©Î ¨Ï¥Î
  Sub disPaste()
Dim i As Integer
Dim PasteCtls As CommandBarControls
Dim PasteCtl As CommandBarControl
    '´M§ä©Ò¦³ [½Æ»s] «ö¶s, ¨äID¬°19
    '´M§ä©Ò¦³ [°Å¤U] «ö¶s, ¨äID¬°23
    '´M§ä©Ò¦³ [¶K¤W] «ö¶s, ¨äID¬°22

    Set PasteCtls = Application.CommandBars.FindControls(Id:=848) ' ¿ï¨ú©Ò»Ý¤§ID-ù
    '±N©Ò¦³ [½Æ»s] «ö¶s¥\¯à¨ú®ø
    i = 0
    Debug.Print PasteCtls.Count
    For Each PasteCtl In PasteCtls
        i = i + 1
        Debug.Print i
        PasteCtl.Enabled = True 'TRUE§Y¥i¦^ÂÐ-ù
    Next
    '¨ú®ø [½Æ»s] §Ö±¶Áä
    Application.OnKey "^v", ""
    '¤u§@ªí¼ÐÅÒ¥kÁä©Ò¸õ¥X¨Óªº "ply" ¤u¨ã¦C"²¾°Ê©Î½Æ»s(M)..." «ö¶s¥i²¾°Ê¨Ã²£¥Í°Æ¥»
    '¦]¦¹¤@¦}¸T¤î
    Application.CommandBars("ply").Controls(5).Enabled = True 'TRUE§Y¥i¦^ÂÐ-ù
    '¥H¤WÀ³¸Ó´NµLªk½Æ»s¤F
End Sub
ù

TOP

·PÁ´£¨Ñªº¸ê°T
§Ú¦A¸Õ¸Õ¬Ý

TOP

        ÀR«ä¦Û¦b : ¡i°±º¢¤£«e¡A²×µL©Ò±o¡j¤H³£°g©ó´M§ä©_ÂÝ¡A¦]¦Ó°±º¢¤£«e¡FÁa¨Ï®É¶¡¦A¦h¡B¸ô¦Aªø¡A¤]¤FµL¥Î³B¡A²×µL©Ò±o¡C
ªð¦^¦Cªí ¤W¤@¥DÃD