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

[µo°Ý] onaction="Macro",macro¦³°Ñ¼Æ¦p¦ó¼g§r

[µo°Ý] onaction="Macro",macro¦³°Ñ¼Æ¦p¦ó¼g§r

onaction="Macro",macro¦³°Ñ¼Æ¦p¦ó¼g§r
lmh

¦^´_ 10# Scott090
actioncontrol »P tag ªº¥Îªk,10#´£¨Ñºô­¶¤¶²Ð«Ü²M·¡,¨Ã¤£½ÆÂø,À³¸Ó¦n¦n¥Î.
lmh

TOP

¦^´_ 13# GBKEE


    ÁÂÁ G¤j «ü¤Þ
    ¾Ç²ß¤F

TOP

¦^´_ 8# Scott090


·N«ü    onaction¤Þ¥Îªºµ{§Ç¤£­n¨Ï¥Î¤Þ¼Æ¡A©Î±N¤Þ¼Æ¥[¤Woptional¡A
¦p¦¹¤@¨Ó¡A¥\¯àªí¶µ¥Ø§Y¤£¥²³Q­­¨î©ó©T©w¤Þ¼Æ¡A
¦Ó¥Ñ¤Þ¥Îªºµ{§Ç¤Þ¥Î¦Û­qÅܼơA
¦p¦¹¤@¨Ó¡A¬Û¦P¥\¯àªí¦b¤£¦Pª¬ªp¤U¡A¥i°õ¦æ¤£¤@¼Ëªºµ{§Ç¹Lµ{¡C
Word§e²{·¥­PªºÀRºA¤§¬ü¡AExcel®i²{·¥­Pªº°ÊºA¤§¬ü¡C

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2018-8-8 16:45 ½s¿è

¦^´_ 12# Scott090

workbookÃö³¬«á¡A¦A¶}±Ò®É  
ThisWorkbook¼Ò²Õ¤W»Ý¦³³o¨Çµ{¦¡½X
  1. Option Explicit
  2. Private Sub Workbook_Open()
  3.     a="EXCEL"
  4. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 11# GBKEE


    ·PÁ G¤j ªº¦^ÂСC
workbookÃö³¬«á¡A¦A¶}±Ò¡A²Ä¤@¦¸°õ¦æ«ö¶s«áÅã¥Ü a="EXCEL"³o­Ó°Ñ¼Æ¨Ã¥¼¶i¨Ó¦p¤U¹Ï
test.JPG

½Ð°Ý¡A°ÝÃD¦b­þ¸Ì
ÁÂÁÂ

TOP

¦^´_ 8# Scott090
  1. Option Explicit
  2. Public a As String   '¤@¯ë¼Ò²Õªº¤Wªº¤½¥ÎÅܼÆ
  3. Sub Ex() 'OnActionªºµ{¦¡½X
  4.     a = "EXCEL" '²Ä¤@¦¸«öButton 1 ªº¤å¦r
  5.       ActiveSheet.Shapes.Range(Array("Button 1")).Select '»Ý´¡¤J«ö¶s(ªí³æ±±¨î¶µ)
  6.     Selection.OnAction = "'Ex_Macro a'"
  7.     ActiveCell.Activate
  8. End Sub

  9. Sub Ex1()
  10.     a = "Ex_Macro"
  11. End Sub
  12. Sub Ex_Macro(ByRef q As String)
  13.     MsgBox q
  14.     Ex1 '²Ä¤G¦¸¥H«á«ö Button 1 ªº¤å¦r
  15. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

actioncontrol »P tag ªº¥Îªk °Ñ¦Ò Microsoft ºô­¶¦p¤U¡G
https://msdn.microsoft.com/en-us/vba/office-shared-vba/articles/commandbars-actioncontrol-property-office#example

TOP

#2,#3,#6
ÁÂÁ¦U¦ìÀ°¦£,§Ú¨D§Uªº°ÝÃD¬Û«H¤£¤Ö¤H³£·Qª¾¹D,³o¨à§Ú¦A²³æ´£¤@´£:
·í§A°µcommandbarbutton,¨ä¤¤¦³¤@¥y"Onaction="sun¦WºÙ"",¦pªGsub¦WºÙ¦³°Ñ¼Æ¥ô¦ó¼g?
µª®×´N¬O#6§i¶Dªº  Onaction="'sub¦WºÙ °Ñ¼Æ'",´N¬OÂù¤Þ¸¹+³æ¤Þ¸¹+sub¦WºÙ+ªÅ®æ+°Ñ¼Æ+³æ¤Þ¸¹+Âù¤Þ¸¹,´N³o»ò²³æ.
¨ä¥L¤èªk¤]´£¨Ñ§Ú­Ì¤£¤Ö«ä¸ô,¦ý´N¤W­z¤@±ø,³Ì²³æ³Ì¦n¥Î,¦A¦¸ÁÂÁ¤j®a!
lmh

TOP

¦^´_ 7# linyancheng


    ½Ð¤j¤j¼g¤@¬qµ{¦¡ªº¨Ò¤l¡A¥H¸ê¼Ò¥é¾Ç²ß
ÁÂÁÂ

TOP

        ÀR«ä¦Û¦b : ¤£­n¤p¬Ý¦Û¤v¡A¦]¬°¤H¦³µL­­ªº¥i¯à¡C
ªð¦^¦Cªí ¤W¤@¥DÃD