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

[µo°Ý]Excel¤¤ªºcheckbox±±¨î¶µ¤Ä¿ï°ÝÃD

[µo°Ý]Excel¤¤ªºcheckbox±±¨î¶µ¤Ä¿ï°ÝÃD

Excel¤¤ªº"±±¨î¤u¨ã½c"ª«¥ócheckbox±±¨î¶µ¡A·í¥´¤Ä®ÉRange("B4")·|ÅܲÊÅé¦r,
·í¨ú®ø¤Ä¿ï®ÉRange("B4")·|¨ú®ø²ÊÅé¦r.vba­n¦p¦ó½s¼g?
¦p¤U¹Ï»¡©úRange(i4)¥´¤Ä,Range(J4)´N·|ÅܲÊÅé
add.jpg

¥t¥~¦p¦óÅý¤u§@ªí¸Ìªº©Ò¦³checkbox¥þ³¡¤Ä¿ï¤Î¥þ³¡¨ú®ø¤Ä¿ï?

¦^´_ 1# qqchange

¨Ï¥Îª«¥óÃþ§OÅý©Ò¦³ªºCheckBox¦³¦P¼Ëªº®ÄªG
ª«¥óÃþ§O.rar (12.76 KB)
play.gif
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

§Ú¬O¾ÇVBA·s¤â,Ãö©ó¦^ÂФº®e·Q½Ð±Ð´X­Ó°ÝÃD
1.CheckBox8_Click()ªº¤º®e¬O«ü¥þ¿ïªº»yªk¶Ü?UBound(MyGroup)¬O¤°»ò·N«ä?
2.class1ªº¤º®e¬O«üÀx¦s®æ¦¡ÅܲÊÅé¶Ü?Àx¦s®æ­n°µ¨ä¥LÅܤƬO¦b³o¸Ì³]©w¶Ü?
3.moudle1ªº»yªk¤£¬O«ÜÀ´?
If cb.progID = "Forms.CheckBox.1" And cb.Object.Caption = "" Then
            ReDim Preserve MyGroup(s)
            Set MyGroup(s).xlBox = cb.Object
            s = s + 1
  End If
4.Public WithEvents xlBox As MSForms.CheckBox -> ¬O¤°»ò·N«ä?

TOP

¦^´_ 3# qqchange

Public MyGroup() As New Class1
Public ³¯­z¦¡ ¦b¼Ò²Õ¼h¦¸¤¤¥Î¨Ó«Å§i¤½¥ÎÅܼơA¨Ã°t¸mÀx¦sªÅ¶¡¡C
MyGroup() : °ÊºA°}¦CÅܼƠ 
As New Class1  «ü©w¬°   ·sªºClass1 ª«¥ó

UBound, WithEvents  3.moudle1ªº»yªk¤£¬O«ÜÀ´?   ¦h¬Ý¬ÝVBAªº»¡©ú´N·|À´¤F

TOP

«D±`ÁÂÁ¨â¦ìª©¥Dªº«ü±Ð
¥þ¿ï®É¥X²{"°}¦C¯Á¤Þ¶W¥X½d³ò" For i = 0 To UBound(MyGroup) ¬O¤°»ò­ì¦]©O?

TOP

¦^´_ 5# qqchange
§Ú´ú¸Õ¨ÃµL¦¹°ÝÃD
§A¬O§_¦³½s¿è¹LVBA¡AµM«á´Nª½±µ¤Ä¿ï¥þ¿ï
³o¼ËMyGroup¨Ã¥¼«Ø¥ß¡A¥²¶·¥ý°õ¦æauto_openµ{§Ç«á¤~¥i¥H¤Ä¿ï
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¥»©«³Ì«á¥Ñ qqchange ©ó 2013-1-18 11:50 ½s¿è

Ãö³¬ÀÉ®×­«·s¶}±Ò´N¤S¥i¥H¤F,¬O¦b½s¼g¨ä¥Lmodule¦³¼vÅT¶Ü:o
ÁÙ¦³¤@­Ó°ÝÃD.¿ï©w¥[²Ê¥i¥H¥ÎRange¶Ü?­n«ç»ò¼g?

TOP

¦^´_ 7# qqchange
¥ÎRange¨Ó¼g¡A³o¥u¬O©w¦ìªº°ÝÃD
§A¸ÕµÛ¥h¤F¸Ñµ{¦¡½X¡A´N·|ª¾¹D¡A­nÅܲÊÅ骺©w¦ì¤è¦¡
¬O§Q¥Î®Ö¨ú¤è¶ôªº¬Û¹ï¥k¤U¤èÀx¦s®æ°µ©w¦ì
­Y¬O§A­n¯S©w¨ä¥L½d³ò¡A´N¥²¶·¾ã²z¥X¹ïÀ³ªº³W«h
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

ÁÂÁÂHsiehªº«ü¾É

TOP

§Ú¤]¦³Ãþ¦üªº»Ý¨D¡A
¤£ª¾¦p¦ó±N©Ò¦³ªºcheckbox «ü©w¬Û¦Pªº¥¨¶°¡H

¨S¥Î¹Lª«¥óÃþ§O¡A
¦ý¥Ø«eÁÙ¬O¤p¾Ç¥Í¡AµLªk¤U¸üÀÉ®×
¥i§_³Ò·Ðª©¥D±N½d¨ÒÀɱHµ¹§Ú©O¡H

ÁÂÁÂ

TOP

        ÀR«ä¦Û¦b : ¤H¥Í¨S¦³©Ò¦³Åv¡A¥u¦³¥Í©Rªº¨Ï¥ÎÅv¡C
ªð¦^¦Cªí ¤W¤@¥DÃD