| 
    
     |  | ▼youga さん: おはようございます。
 
 
 ユーザーフォーム(Userform1)に
 テキストボックス---Textbox1
 コンボボックス-----Combobox1
 コマンドボタン-----Commandbutton1
 が配置されていたとします。
 
 このUserform1のモジュールに
 
 '=============================================================
 Option Explicit
 '=============================================================
 Private Sub CommandButton1_Click()
 With ComboBox1
 If .ListCount = 0 Then
 ReDim temp(0, 0)
 temp(0, 0) = TextBox1.Value
 .List = temp()
 Erase temp()
 
 ElseIf IsError(Application.Match(TextBox1.Value, .List, 0)) Then
 .AddItem TextBox1.Value
 End If
 End With
 End Sub
 
 標準モジュールに
 '=========================================================
 sub main()
 userform1.show
 ens sub
 
 でmainを実行してみてください
 
 Userform1が表示されたら、
 テキストボックスに適当な文字を入れ、コマンドボタンを押してください。
 コンボボックスにテキストボックスの内容がリストとして登録されます。
 尚、既に登録されている内容は重複チェックを行い、登録をいたしません。
 
 こんな仕様になっています。
 試してみてください。
 
 Excel2002で確認
 
 
 |  |