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

§Q¥ÎVBA ªí³æ»s§@¸U¦~¾ä?

¦^´_ 15# GBKEE


    ·PÁ¤j¤j¸Ñ¶}§ÚªººÃ´b
    ­ì¨Ó§Ú§Ë¿ù¦a¤è¤F
    ¨Sª`·N¨ìClass ª«¥óÃþ§O¼Ò²Õ¸Ì­±ªºµ{¦¡½X
    ·d¤£À´ OB¬O¤°»ò·N«ä

    ­è­è¬O·Q¦b
    With Controls.Add("Forms.OptionButton.1", I) ¸Ì­±¥[¤J
    If .Visible = True Then
    Sheet1.Range("A1") = DateSerial(ComboBox1, ComboBox2, Day(I))
    End If
   
    ¦ý­ì¥»ªí³æ¤W­±´N¨S¦³¥X²{OptionButton
    ©Ò¥H¤Ñ¼Æ¨º¸Ì¤]¤£¾å±o«ç»ò¥Î
    ²{¦b§Úª¾¹D¤F

    ¤£¹L¬Ý¨Ó§ÚÁÙ­nÄ~Äò¥[ªo¤F...><
Jared

TOP

¦^´_ 14# Jared
ª«¥óÃþ§O¼Ò²Õ Class1
  1. Option Explicit
  2. Public WithEvents OB As MSForms.OptionButton
  3. Private Sub OB_Click()
  4.     'MsgBox OB.Caption
  5.     '¦~¤ë¤é
  6.     Sheet1.[a1] = OB.ControlTipText
  7.     '¤é´Á
  8.     'Sheet1.[a1] = OB.Caption
  9. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 12# GBKEE


    ·Q½Ð°Ý¤@¤U¤j¤j
    µ{¦¡¤¤·í§ÚÂI¿ï¤é´Áªº®É­Ô
    ·|¸õ¥Xĵ§iµøµ¡
    §iª¾§AÂI¿ïªº¬O¦~¤ë¤é

    ¨º¦pªG¬O­nÂI¿ï¤é´Á«á´N°Ê§@
    ª½±µ¼g¤J«ü©wÄæ¦ì¬O­n¦b­þ¸Ì¼¶¼g©O¡H(¨Ò¦p¡GSheet1.Range("A1"))
¡@¥Ñ©óªí³æ­¶­±¤WªºOptionButton³£¬OÁôÂêº
    ¦]¦¹§Ú²K¥[µ{¦¡¤£¾å±o¼g­þ¸Ì
   
    §Æ±æ¤j¤j¸Ñ°£§ÚªººÃ´b
    ·P¿E¤£ºÉ¡I><
Jared

TOP

¦^´_ 11# mark15jill


¤j¤j
«á¨Óµo²{¹Bºâ¦¡³£¿ù¤F
­pºâ¥X¨Óªº¤Ñ¼Æ³£¤£¹ï....><
Jared

TOP

¦^´_ 9# Jared
  1. ³o­Ó¤ëªº²Ä¤@¤Ñ    DateSerial(ComboBox1, ComboBox2, 1)
  2. ³o­Ó¤ëªº³Ì«á¤@¤Ñ DateSerial(ComboBox1, ComboBox2.Value + 1, 0)
½Æ»s¥N½X
­×§ï 5# ÀÉ®× ªí³æµ{¦¡½X ¦p¤U
  1. Option Explicit
  2. Dim Class_OB(1 To 7, 1 To 6) As New Class1
  3. Private Sub UserForm_Initialize()
  4.     Dim I As Integer
  5.      ¤é´Á¶µ
  6.     For I = 1980 To 2099
  7.         ComboBox1.AddItem I
  8.     Next
  9.     ComboBox1.Value = Year(Date)
  10.     For I = 1 To 12
  11.         ComboBox2.AddItem I
  12.     Next
  13.     ComboBox2.Value = Month(Date)
  14. End Sub
  15. Private Sub ComboBox1_Change()
  16.     ¤ë¾ä
  17. End Sub
  18. Private Sub ComboBox2_Change()
  19.     ¤ë¾ä
  20. End Sub
  21. Private Sub ¤ë¾ä()
  22.    ¤ë¾ä²M°£
  23.     If ComboBox1.ListIndex > -1 And ComboBox2.ListIndex > -1 Then ¸U¦~¾ä
  24. End Sub
  25. Private Sub ¸U¦~¾ä()
  26.     Dim R As Integer, I As Date, WD As Integer
  27.      R = 1
  28.      For I = DateSerial(ComboBox1, ComboBox2, 1) To DateSerial(ComboBox1, ComboBox2.Value + 1, 0)
  29.         WD = Weekday(I)
  30.         With Controls(R & "_" & WD)
  31.             .Enabled = True
  32.             .Caption = Day(I)
  33.             .ControlTipText = I
  34.         End With
  35.         If WD = 7 Then R = R + 1
  36.      Next
  37. End Sub
  38. Private Sub ¤é´Á¶µ()
  39.     Dim OBtop As Integer, OBLeft As Integer, R As Integer
  40.     Dim OB_1 As Integer, OB_2 As Integer
  41.     R = Label1.Top + 30
  42.       For OB_2 = 1 To UBound(Class_OB, 2)
  43.         For OB_1 = 1 To UBound(Class_OB, 1)
  44.             With Controls.Add("Forms.OptionButton.1", OB_2 & "_" & OB_1)
  45.                 .Visible = True
  46.                 .Top = R '
  47.                 .Left = Controls("Label" & OB_1).Left
  48.                 'Controls("Label" & OB_1)->¤w«Ø¥ß¬P´Á¤§ Label±±¨î¶µ
  49.                 '¦WºÙ¨Ì§Ç¬°Label1,Label2,Label3,Label4,Label5,Label6,Label7.
  50.                 .Height = 15
  51.                 .Width = 30
  52.                 .ControlTipText = ""
  53.             End With
  54.             Set Class_OB(OB_1, OB_2).OB = Controls(OB_2 & "_" & OB_1)
  55.         Next
  56.         R = R + 30
  57.      Next
  58. End Sub
  59. Private Sub ¤ë¾ä²M°£()
  60.     Dim E As Control
  61.     For Each E In Me.Controls
  62.         If E.Name Like "*_*" Then
  63.             E.Enabled = False
  64.             E.Caption = ""
  65.             E.ControlTipText = ""
  66.         End If
  67.     Next
  68. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 9# Jared

§A³o°ÝÃD¦³¥i¯à¬O ´`Àô¤º §A§Ë¿ù°Ñ¼Æ..

¨Ò¦p
k=1
for hwe = 1 to 31

    me.controls("optionbutton"& hwe ) = hwe

next

  ¦h°µ¦h·Q¦h¾Ç²ß¡A¤Ö¬Ý¤Ö¿ù¤Ö°g³~

  ¦h°µ=¦h¦h½m²ß¡A¦h¦h½s¼g¡C
  ¦h·Q=·Q·Q¬°¤°»ò¤H®aµ{¦¡­n¨º¼Ë¼g¡A¦pªG´«¦¨¦Û¤v¡A¤S·|«ç¼g¡C
  ¦h¾Ç²ß=¾Ç²ß¤H®aªºµo°Ý¨Ã¸Ñµª¡A¾Ç²ß¤H®aªº¼gªk

  ¤Ö¬Ý=¥u¬Ý¤£°µ¤]ªPµM

TOP

¦^´_ 7# GBKEE


    ©çÁÂ..  ¦]¬°·Q»¡©ç¦¨¤@±i ¤ñ¸û¬ÙªÅ¶¡...
¤U¦¸·|§ï«Ø...

  ¦h°µ¦h·Q¦h¾Ç²ß¡A¤Ö¬Ý¤Ö¿ù¤Ö°g³~

  ¦h°µ=¦h¦h½m²ß¡A¦h¦h½s¼g¡C
  ¦h·Q=·Q·Q¬°¤°»ò¤H®aµ{¦¡­n¨º¼Ë¼g¡A¦pªG´«¦¨¦Û¤v¡A¤S·|«ç¼g¡C
  ¦h¾Ç²ß=¾Ç²ß¤H®aªºµo°Ý¨Ã¸Ñµª¡A¾Ç²ß¤H®aªº¼gªk

  ¤Ö¬Ý=¥u¬Ý¤£°µ¤]ªPµM

TOP

¦^´_ 7# GBKEE


    ¦^ÂФj¤j
    DAY_i ¬O¦p¦ó³]©wªº?
    DAY_i ´N¬OOptionButton1 ÄÝ©ÊNAME §ï¦¨DAY_1 ~42
       
¬O·Q§Q¥ÎFor °j°é¥h­pºâ
³Ì«á¦b¥[¤W§PÂ_¦¡
­pºâ¥X¨Óªº¼Æ¦r¤p©ó1©Î¤j©ó31´NÁôÂð_¨Ó
¦ý´N¬O¶]¤£¹L¥d¦b³o¸Ì

    ­è­è§Q¥Î¤j¤jªº¦^Âе{¦¡½X¦¨¥\¤F(^¤f^)
     ¤£¹L«oÅܦ¨¦P¤@ºØ¼Æ¦r....(u_u)
      
Jared

TOP

¦^´_ 5# GBKEE


    (0¤f0)...·Q½Ð°Ý¤j¤j
    ¬°¤°»òµe­±¤@¶}©l³£¨SªF¦è?
    ¬O¦b­þ¤@¦æµ{¦¡«Å§iÁôÂéO?
    µ{¦¡¤¤ «Å§i ¦n¦h¨S¨£¹Lªº»yªk(@@)...
Jared

TOP

¦^´_ 6# Jared
¦ýµ{¦¡´N§PÂ_§ä¤£¨ìDAY_i.Caption ³o­Ó¦¨­û....
¨S¦³Àɮ׬ݤ£¨ì DAY_i ¬O¦p¦ó³]©wªº,¬O³o¼Ë¶Ü?
  1. Controls("DAY_" & I).Caption
½Æ»s¥N½X
¦^´_ 4# mark15jill

¹Ï¤ù¤Wªºµ{¦¡½X,»Ý­n¦³¦n²´¤O¤~¬Ýªº¨ì,¦ó¤£¥N½X¶K¤W¨Ó
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : ¤£­nÀH¤ß©Ò±ý¡A­nÀH¤ß±Ð¨|¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD