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

¨D ¶}±Òªí³æ¦Û°Ê·s¼W¤å¦r¤è¶ô »P¤U©Ô¦¡²M³æ

¦^´_ 1# joe80502
  1. Private Sub UserForm_Initialize()
  2. With ActiveSheet
  3. For Each a In .Range("A:A").SpecialCells(xlCellTypeConstants)
  4.    With Me.Controls.Add("Forms.TextBox.1")
  5.    .Top = i * 22
  6.    .Height = 20
  7.    .Width = 60
  8.    .Left = 10
  9.    .Value = a
  10.    End With
  11.    With Me.Controls.Add("Forms.ComboBox.1")
  12.    .Top = i * 22
  13.    .Height = 20
  14.    .Width = 60
  15.    .Left = 50
  16.    End With
  17.    i = i + 1
  18. Next
  19. End With
  20. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 4# joe80502
¦^¶ñ¸ê®Æ¨ì¤u§@ªí¤¤¡A¥i§Q¥ÎControlSourceÄÝ©Ê
  1. Private Sub UserForm_Initialize()
  2. With ActiveSheet
  3. For Each a In .Range("A:A").SpecialCells(xlCellTypeConstants)
  4.    With Me.Controls.Add("Forms.TextBox.1")
  5.    .Top = i * 22
  6.    .Height = 20
  7.    .Width = 60
  8.    .Left = 10
  9.    .Value = a
  10.    End With
  11.    With Me.Controls.Add("Forms.ComboBox.1")
  12.    .Top = i * 22
  13.    .Height = 20
  14.    .Width = 60
  15.    .Left = 50
  16.    .ControlSource = a.Offset(, 5).Address '³sµ²Àx¦s®æ
  17.    .RowSource = ¤u§@ªí1.[A1:A7].Address '²M³æ¨Ó·½
  18.    End With
  19.    i = i + 1
  20. Next
  21. End With
  22. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

        ÀR«ä¦Û¦b : ­n¤ñ½Ö§ó¨ü½Ö¡D¤£­n¤ñ½Ö§ó©È½Ö¡C
ªð¦^¦Cªí ¤W¤@¥DÃD