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

[½Ð±Ð]±±¨î¶µ¸s²Õ¤Æ½Æ»s°ÝÃD

[½Ð±Ð]±±¨î¶µ¸s²Õ¤Æ½Æ»s°ÝÃD

¦bform¤¤¸m©ñ¤@­Óframe¡A¨ä¤W¦³¤@­ÓCommandButton¤Î¤@­Ólabel
½Ð°Ý¡A¥i¥H¦b°õ¦æ®É¡A½Æ»s¥X¬Û¦Pµ²ºc·sªºframe¶Ü

¦bform¤¤¸m©ñ¤@­Óframe¡A¨ä¤W¦³¤@­ÓCommandButton¤Î¤@­Ólabel
½Ð°Ý¡A¥i¥H¦b°õ¦æ®É¡A½Æ»s¥X¬Û¦Pµ²ºc·sªºfra ...
abbay262 µoªí©ó 2019-11-19 18:43


¥i¥Hªº, ½Æ»s¶K¤W´N¦n..
  1. Private Sub cbCopyFrame_Click()
  2.   Frame1.Copy
  3.   Me.Paste
  4. End Sub
½Æ»s¥N½X
¨î¶µ¸s²Õ¤Æ½Æ»s-ans.zip (18.8 KB)

TOP

§Ú­ì¥»¬O­n°ÝVBA¤WªºUSERCOTROLS¡A«á¨Ógoogle«á¡A¨Ã¨S¦³³o¥\¯à¡A·PÁ±zªº¦^µª¡A³º¯à¦p¦¹À³¥Î¡I¤Q¤À¯«©_¡I

½Ð°Ý¦b±zªº¦^µª¤W¡Aframe1¥H¤Î¶K¤W«áªºframe2¤WªºCommandButton1¡BLabel1§¡¬O¬Û¦P¦WºÙ¡A³o­n¦p¦ó¤Þ¥Î©O¡H

TOP

©Ó¤W¡A
luh¤j¡A³o­ÓFrame¥Î¦bSheet¤W¥i¦æ¡A¦ý¥Î¦bUserForm¤W¡A«K·|¿ù»~¡A½Ð°Ý¬OMeªº°ÝÃD¶Ü¡H
  Frame1.Copy
  Me.Paste

TOP

¦Ûµª#3°ÝÃD
#4ªº°ÝÃDÁÙ¦b¡A½Ð°ª¤â¸Ñ´b°Ú

    For Each ctl In Me.Controls
        If TypeName(ctl) = "TextBox" Then ctl.Text = ""
    Next

TOP

¥»©«³Ì«á¥Ñ luhpro ©ó 2019-11-23 09:28 ½s¿è
½Ð°Ý¦b±zªº¦^µª¤W¡Aframe1¥H¤Î¶K¤W«áªºframe2¤WªºCommandButton1¡BLabel1§¡¬O¬Û¦P¦WºÙ¡A³o­n¦p¦ó¤Þ¥Î©O¡H
abbay262 µoªí©ó 2019-11-22 20:48

¦]¬°¥¦­Ì¬OÁõÄݩ󤣦Pªº Frame ª«¥ó°Ú,
¤@­Ó¬O frame1.CommandButton1
¥t¤@­Ó¬O frame2.CommandButton1
¦b¨ú¥Î¤W¬O¨S¦³½Ä¬ðªº.
luh¤j¡A³o­ÓFrame¥Î¦bSheet¤W¥i¦æ¡A¦ý¥Î¦bUserForm¤W¡A«K·|¿ù»~¡A½Ð°Ý¬OMeªº°ÝÃD¶Ü¡H

Me ¦b¦¹³B¬Oªí¥Ü Worksheet ¤£¬O UserForm,
§Ú¬O·~¾lªº,
¨S¸Õ¹L³o¼Ë¶K,
²{¦b»°µÛ­n¥Xªù,
±ßÂI¦A¸Õ¸Õ...
For Each ctl In Me.Controls
         If TypeName(ctl) = "TextBox" Then ctl.Text = ""
     Next

­ì¦]¦P¤W,
Me ¦b¦¹³B¬Oªí¥Ü Worksheet ¤£¬O UserForm,

§A¥i¥H¦b "§Y®É¹Bºâµøµ¡"(«ö Ctrl + G ¶}±Ò) ¤W¥´ debug.print me.name ¦A«ö Enter Áä´N¥i¥H½T»{ Me ¬O­þ­Óª«¥ó.

§A¸Õ¸Õ :
With Me .Frame1
    For Each ctl In .Controls
         If TypeName(ctl) = "TextBox" Then ctl.Text = ""
     Next
End With

·íµM Frame2 ¤ñ·Ó§Y¥i. (Ps §Ú¨S´ú¹L, ¤£½T©w¥i¤£¥i¥H, µ¥¦^¨Ó«á¦A¤W¨Ó¦^¤å)

TOP

¥»©«³Ì«á¥Ñ luhpro ©ó 2019-11-23 13:32 ½s¿è

­ì¤å¤£Åý½s¿è¥u¯à­«¶}¤@½g§ó·s¤F.
4# luh¤j¡A³o­ÓFrame¥Î¦bSheet¤W¥i¦æ¡A¦ý¥Î¦bUserForm¤W¡A«K·|¿ù»~¡A½Ð°Ý¬OMeªº°ÝÃD¶Ü¡H
  Frame1.Copy
   Me.Paste

­è­è¸Õ¹LUserform ¤ºªºª«¥ó¤£¯à¶K¤WSheet,
§Ú²qÀ³¸Ó¬O¦]¬° UserForm ¬O¦b½s¿èµøµ¡¤¤«Ø¥ßªºª«¥ó,
¥¦¤º³¡ªºª«¥ó¤]¥u¯à±M¥Î©ó UserForm,
©Ê½è»P¤u§@ªí¤¤ªºª«¥ó¤£¤@¼Ë,
(³Ì©úÅ㪺¨Ò¤l¬O CommandButton ³o­Óª«¥ó,
Worksheet ¤¤¦³ Copy ¤èªk ¦Ó Userform «hµL.)

©Ò¥H¤£¯à¤¬¬Û½Æ»s¨Ï¥Î.

¤£¹L Userform ÁÙ¬O¥i¥H°ÊºA(¤£¬O½s¿è®É´N«Ø¥ß¦nªº)·s¼Wªº,
½Ð°Ñ¬Ý³o½g :
[µo°Ý] °ÊºA·s¼W UserForm ¤Î CommandButton «á ¦p¦ó¼gclickªº°Ê§@¡H
©Ò¥H­n¦A·s¼W¤@­Ó¦³¬Û¦Pª«¥óªº Userform ¬O¨S°ÝÃDªº.

¦Ü©ó­Y¬O§A­n (½Æ»s) ¤@­Ó Userform ¤Wªºª«¥ó¹L¥h Sheet,
¦b Sheet ¤W·s¼W¦P«¬ª«¥ó,
¦A³v­Ó±NÄÝ©Ê«ü©wµ¹·s¼Wªºª«¥ó¤]¬O¤@­Ó¥i¦Ò¼{ªº¤è¦V.

TOP

        ÀR«ä¦Û¦b : ¤ß¤¤±`¦sµ½¸Ñ¡B¥]®e¡B·P«ä¡Bª¾¨¬¡B±¤ºÖ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD