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

[µo°Ý] CheckBox ¤Î optionbutton ÂI¿ï¿ï¶µ«á ¥i§_³]­p±a¥Xtextbox ¿é¤J¸ê®Æ

¦^´_ 2# GBKEE


    ¬Ý¨ì±zªº¦^µª,²ª½­nµh­ú¬y®÷,¤u§@¤Wªº²~ÀV,¦b¦¹³£¯àì±o¸Ñ¨M,³o¨à¯u¬O¦n,ÁÂÁ±z,
¤]·PÁ¤j®a,­n«ç¼Ë¹³±z­Ì¤@¥b±j,¨C¦¸¦h³Â·Ð¤j®a,¯u·P®¦!
max

TOP

¦^´_ 1# user999
  1. Option Explicit
  2. Private Sub UserForm_Initialize()
  3.     Dim LeftPos As Integer, TopPos As Integer, NewHeight As Integer, NewWidth As Integer, Rng As Range, H As Integer, i As Integer
  4.     Dim NewOptionButton As MSForms.Control
  5.     H = 1
  6.     NewHeight = 15
  7.     With Sheet1
  8.         With .Columns(1)
  9.             Set Rng = Sheet1.Range(.Cells(2), .Cells(2).End(xlDown))
  10.             ComboBox1.List = Rng.Value
  11.         End With
  12.         With .Columns(2)
  13.             Set Rng = Sheet1.Range(.Cells(2), .Cells(2).End(xlDown))
  14.             NewWidth = (Frame2.Width - (Rng.Count * H)) / Rng.Count
  15.             TopPos = (Frame2.Height - NewHeight) / 2
  16.             For i = 1 To Rng.Count
  17.                 LeftPos = 1 * H + (i - 1) * NewWidth
  18.                 Set NewOptionButton = _
  19.                 Frame2.Controls.Add("forms.OptionButton.1")
  20.                 With NewOptionButton
  21.                     .Width = NewWidth
  22.                     .Caption = Rng.Cells(i)
  23.                     .Height = NewHeight
  24.                     .Left = LeftPos
  25.                     .Top = TopPos
  26.                     .AutoSize = True
  27.                 End With
  28.             Next
  29.         End With
  30.         With .Columns(3)
  31.             Set Rng = Sheet1.Range(.Cells(2), .Cells(2).End(xlDown))
  32.             NewWidth = (Frame3.Width - (Rng.Count * H)) / Rng.Count
  33.             TopPos = (Frame3.Height - NewHeight) / 2
  34.             For i = 1 To Rng.Count
  35.                 LeftPos = 1 * H + (i - 1) * NewWidth
  36.                 Set NewOptionButton = _
  37.                 Frame3.Controls.Add("forms.CheckBox.1")
  38.                 With NewOptionButton
  39.                     .Width = NewWidth
  40.                     .Caption = Rng.Cells(i)
  41.                     .Height = NewHeight
  42.                     .Left = LeftPos
  43.                     .Top = TopPos
  44.                     .AutoSize = True
  45.                 End With
  46.             Next
  47.         End With
  48.     End With
  49. End Sub
½Æ»s¥N½X

TOP

CheckBox ¤Î optionbutton ¤¤¿ï¶µ ¥i§_³]­p¦¨ ¨Ó·½¨úexcelªí®æ¬YÄæ¦ì

½Ð±Ð¦U¦ì CheckBox ¤Î  optionbutton ¤¤¿ï¶µ ¥i§_³]­p¦¨ ¨Ó·½¨úexcelªí®æ¬YÄæ¦ì,¦pªþ¥ó»¡©ú
Àµ½Ð½Ñ¦ìÀ°¦£ ÁÂÁÂ!

test0725.rar (24.25 KB)

max

TOP

        ÀR«ä¦Û¦b : ªY½à§O¤H´N¬O²øÄY¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD