| 
    
     |  | こんにちは。 暦をつくり、日別になっているセルに、コメントをユーザフォームを経由して入れたいとおもっています。
 
 A列はSUN,BはMON・・・G列はSATです。(1、2行目はタイトルです。)
 したがって2007年1月なら"B3"に"1","C3"に"2"・・・"D7"に"31"と入っています。
 
 いま、ユーザフォームのCOMBOBOXに1−31まで肢を設けます。
 またTextBoxを計6個設けます。
 COMBOBOXで1を選び、TextBoxにそれぞれ任意のcharを入れeNTERすると、"B3"にコメントとして入る、というふうにしたいのです。
 (そのとき各TextBoxに入力された値は、改行して6行にして表示したい。)
 
 下をご覧ください。
 ここまで自力でできました。
 ていうかこの方向性でいいのかわかりません。
 どなたかこのあとどうすればいいかご教授ねがえませんでしょうか。
 
 *****
 
 Private Sub CommandButton1_Click()
 
 Dim ComS As String
 Dim Rc As Integer
 Dim Sc As Long
 Dim MyR As String
 Dim C As Range
 Dim flg As Boolean
 
 
 For Each C In Range("A3", "B3", "C3", "D3", "E3", "F3", "G3", "A4", "B4", "C4", "D4", "E4", "F4", "G4", _
 "A5", "B5", "C5", "D5", "E5", "F5", "G5", "A6", "B6", "C6", "D6", "E6", "F6", "G6", "A7", "B7", "C7", "D7", "E7", "F7", "G7")
 If C.Text = ComboBox1.Value Then Sc = C.Column
 If C.Text = ComboBox1.Value Then Rc = C.Row: Exit For
 Next
 
 If Sc = 0 Or Rc = 0 Then
 flg = True: GoTo Eline
 End If
 
 Eline:
 Application.EnableEvents = False
 If flg Then
 MsgBox "入力した日はありません"
 Else
 
 ComS = TextBox1.Value & TextBox2.Value & TextBox3.Value & TextBox4.Value & TextBox5.Value & TextBox6.Value
 Cells(Rc, Sc).AddComment ComS
 Cells(Rc, Sc).Comment.Visible = False
 
 End Sub
 
 Private Sub CommandButton2_Click()
 
 ComboBox1.Value = ""
 TextBox1.Value = "A:"
 TextBox2.Value = "B:"
 TextBox3.Value = "C:"
 TextBox4.Value = "D:"
 TextBox5.Value = "E:"
 TextBox6.Value = "F:"
 
 End Sub
 
 |  |