ユーザーフォームを利用する:Excel VBA入門 |
スポンサードリンク | |
Sub myform1() UserForm1.Show End Sub |
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) If MsgBox("終了しますか?", vbYesNo) = vbYes Then Cancel = False Else Cancel = True End If End Sub |
Private Sub Commandbutton1_click() Dim lRow As Long With Worksheets("Sheet1") lRow = .Range("A" & Rows.Count).End(xlUp).Row .Range("A" & lRow + 1).Value = TextBox1.Value End With TextBox1.Value = "" TextBox1.SetFocus End Sub |
Private Sub CommandButton2_Click() Unload UserForm1 End Sub |
Private Sub CommandButton2_Click() Unload Me End Sub |
スポンサードリンク
PageViewCounter
Since2006/2/27