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

¤u§@ªí worksheet ª«¥ó¨Æ¥ó¨ç¼Æ¤º°Ñ¼Æ Cancel ¥Îªk

¤u§@ªí worksheet ª«¥ó¨Æ¥ó¨ç¼Æ¤º°Ñ¼Æ Cancel ¥Îªk

½Ð°Ý\
³o­Ó¨Æ¥ó¨ç¼Æ Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Cancel ¬O¹ï¬Æ»ò¨Ó©w¸q¥¬ªL­È¡A¥¦ªº·N¸q¬O¤°»ò
¥i§_Á|¨Ò»¡©ú­n«ç»ò¥Î?

ÁÂÁÂ

±`ºA¤U·í¬Y cell ³QÂù·¥®É, ·|¥X²{¥i¥H¤å¦r½s¿èªº°{Ã{´å¼Ð

Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Cancel = True
End Sub

¥[¤J Cancel = True «á
¤£·|¥X²{¥i¤å¦r½s¿èªº°{Ã{´å¼Ð

TOP

¦^´_ 2# jackyq
¤j¤j§A¦n, ¥¦ªº§@¥Î¬O¤°»ò?
¦³¤°»ò¥Î³~?

TOP

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2015-12-7 07:06 ½s¿è

¦^´_ 1# Scott090
Á|­Ó¨Ò¤l¨Ó»¡©ú¡G
¤u§@ªí1 (¤u§@ªí1)¡G
  1. Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
  2.     If Not (Target.Column = 1 Or Target.Column = 2) Then Exit Sub
  3.     Cancel = True

  4.     If Target.Column = 1 Then
  5.         ¤u§@ªí1.Ex
  6.     Else
  7.         ¤u§@ªí2.Ex
  8.     End If
  9. End Sub

  10. Sub Ex()
  11.     MsgBox "¤u§@ªí1"
  12. End Sub
½Æ»s¥N½X
¤u§@ªí2 (¤u§@ªí2)¡G
  1. Sub Ex()
  2.     MsgBox "¤u§@ªí2"
  3. End Sub
½Æ»s¥N½X
»¡©ú¤@¡G
  1. Cancel As Boolean (­ì¤å)
  2. False when the event occurs. If the event procedure sets this argument to True,
  3. the default double-click action isn't performed when the procedure is finished.
½Æ»s¥N½X
°Ñ¼Æ Cancel ¹w³]­È¬° False¡A¥ç§Y·í¬° False ­È«h±Ò°Ê¸Ó¨Æ¥ó¡F§A¥i¸ÕµÛ¦b¦³Äæ¦ì­Èªº
Äæ¦ì¤º¡A·Æ¹«³s«ö¨â¤U§A·|µo²{¸ÓÄæ­È·|¤Ï¥Õ©Î°{Ã{¡C
¦p¸Ó¤Þ¼Æ«Å§i¬° True ®É¡A¸ÓÂùÀ»ªº°Ê§@§¹¦¨®É¡A¤Ï¥Õ©Î°{Ã{³£¬O²@µL§@¥Îªº¡A
·N§Y¤£·|±Ò°Ê¸Ó¨Æ¥óªº¤Ï¥Õ©Î°{Ã{¤§´£¥Ü§@¥Î¡C
»¡©ú¤G¡G
  1. Need help with code to do the folowing when clicking on diffrent cells
  2. in a worksheet  (»Ý­n¦b¸Ó¤u§@ªí¤¤¥[¤J¥H¤U¤§µ{¦¡½X)

  3. Column A when clicket in any row show form1.Ex  (»Ý¦b"¤u§@ªí1"¥[¤J¤@ Sub Ex() µ{¦¡½X)
  4. Column B when clicket in any row show form2.Ex  (»Ý¦b"¤u§@ªí2"¥[¤J¤@ Sub Ex() µ{¦¡½X)
½Æ»s¥N½X
·í³QÂI¿ïªºÄæ¦ì¬° A Äæ®É¡A«h°õ¦æ ¤u§@ªí1.Ex¡F
·í³QÂI¿ïªºÄæ¦ì¬° B Äæ®É¡A«h°õ¦æ ¤u§@ªí2.Ex¡C

TOP

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2015-12-7 07:15 ½s¿è

¦^´_ 3# yen956
§A¥i¥H¸ÕµÛÆ[¹î¡G
  1. Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
  2.     Cancel = True
  3.     If Not (Target.Column = 1 Or Target.Column = 2) Then Exit Sub
  4.     '  Cancel = True
  5.             .
  6.             .
  7.             .
  8. End Sub
½Æ»s¥N½X
»P¤U¦C¤£¦Pªº³B¸Ì¤§¶¡ªº¤£¦PÅܤơG
  1. Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
  2.     '  Cancel = True
  3.     If Not (Target.Column = 1 Or Target.Column = 2) Then Exit Sub
  4.     Cancel = True
  5.             .
  6.             .
  7.             .
  8. End Sub
½Æ»s¥N½X

TOP

¦^´_ 2# jackyq

ÁÂÁ§Aªº´£¥Ü

TOP

¦^´_ 5# c_c_lai

«D±`·P®¦  ¸ÔºÉªº¸Ñ»¡
¦Û±qWin soft §ó·s§â ActiveX±±¨î¶µ·dÃa¥H«á¡A´NºÉ¥i¯à¤£¥Î CommandButtom
¦Ó§ï¥Ñ Worksheet ¨Æ¥ó¨ú¥N

TOP

¥»©«³Ì«á¥Ñ jackyq ©ó 2015-12-7 08:44 ½s¿è

¦^´_ 3# yen956


    ¹ê²{«ü©wªº cell , ¨Ï¨ä¸T¤î³Q¤â°Ê­×§ï´Á­È
    ¤£·|¥X²{¥i¤å¦r½s¿èªº°{Ã{´å¼Ð
    ¦ÛµM´NµLªk¤â°Ê­×§ï Range

TOP

¦^´_ 8# jackyq
ªGµM¥i¥H¸T¤î¥Î "DoubleClick" ªº¤èªk­×§ïCellªº­È(ÁöµM¥i¥Î¨ä¤èªk),
ÁÂÁ¤j¤jªº»¡©ú»P«ü¾É!!

TOP

¦^´_ 5# c_c_lai
ÁÂÁÂc¤j¸ÔºÉªº»¡©ú, ¨S·Q¨ì¸T¤î "DoubleClick" ÁÙ¬O¦³¥¦ªº¯S©w¥Î³~.
p.s. Ãö©ó ºÊ¬Ýµøµ¡¤wª¾¹D«ç¼Ë¥Î¤F(¥]¬A¥Î¥kÁä), ¯u¦n¥Î,
¤£ºÞ¥Î¨Ó°lºî¦Û¤wªºVBA, ÁÙ¬O¤j¤j­Ì¯«©_ªºVBA§¡«Ü¤£¿ù, ÁÂÁÂ!!

TOP

        ÀR«ä¦Û¦b : ¨C¤ÑµL©Ò¨Æ¨Æ¡A¬O¤H¥Íªº®ø¶OªÌ¡A¿n·¥¡B¦³¥Î¤~¬O¤H¥Íªº³Ð³yªÌ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD