| 
    
     |  | ▼てっちゃん さん: >▼Statis さん:
 >>こんにちは
 >>シート名も変更するのでしたね
 >>抜けていました。
 >>
 >>
 >>Sheet2のデータの変更ですが
 >>Sheet2のセルA1からA50にあるなら提示してコードでOKはずですが?
 >>
 >>変数「Co」はモジュールの先頭にて宣言してますか?
 >>
 >>Dim Co As Long
 >>Private Sub ComboBox1_Change()
 >> Co = Me.ComboBox1.ListIndex
 >> Me.TextBox1.Value = Me.ComboBox1.Value
 >>End Sub
 >>
 >>Private Sub CommandButton1_Click()
 >> Sheets("Sheet2").Cells(Co + 1, 1).Value = Me.TextBox1.Value
 >>End Sub
 >
 >
 >なんとか作ってみました
 >これでいかがでしょうか?
 >いけないところや、こうした方が良いというところがあれば、ご指導願います。
 >
 >Dim Co As Long
 >Dim Mys As String
 >Private Sub ComboBox1_Change()
 > Me.TextBox1.Value = Me.ComboBox1.Value
 >End Sub
 >Private Sub CommandButton1_Click()
 > Co = Me.ComboBox1.ListIndex
 > Sheets("データ").Cells(Co + 1, 1).Value = Me.TextBox1.Value
 > Mys = Me.ComboBox1.Value
 >
 > Worksheets(Mys).Name = TextBox1
 >End Sub
 >
 >Private Sub CommandButton2_Click()
 >Unload Me
 >End Sub
 >
 >Private Sub UserForm_Initialize()
 >Me.ComboBox1.List = Sheets("データ").Range("A1:A50").Value
 >End Sub
 
 
 すみません。上記コードで試したのですがsheet1上のcomboboxに表示されている名前とは違う名前をuserform上のcomboboxより選択し変更したらエラーが出てしまいます。
 
 |  |