|
▼tuki さん:
>エクセルVBEのマクロ入力下記でいかがでしょうか?
>
>-----------------------------------------------------------------
Private Sub CommandButton1_Click()
Dim lRow As Long
TextBox1.SetFocus
With Worksheets("Sheet1")
lRow = .Range("A" & Rows.Count).End(xlUp).Row
If TextBox1.Value = "" Or TextBox2.Value = "" Then
MsgBox "入力されていない箇所があります"
Exit Sub
End If
.Range("A" & lRow + 1).Value = TextBox1.Value
.Range("B" & lRow + 1).Value = TextBox2.Value
If TextBox1.Value = True Then
.Range("A" & lRow + 1).Interior.ColorIndex = 3
End If
If TextBox2.Value = True Then
.Range("B" & lRow + 1).Interior.ColorIndex = 3
End If
End With
TextBox1.Text = ""
TextBox2.Text = ""
End Sub
>-----------------------------------------------------------------
|
|