반응형

Private Sub CommandButton1_Click()
    Dim answer As Integer
    
    answer = MsgBox("Are you sure you want to empty the sheet?", vbYesNo + vbQuestion, "Empty Sheet")
    
    If answer = vbYes Then
      Cells.ClearContents
    Else
      'do nothing
    End If
End Sub

Private Sub CommandButton2_Click()
    myvalue = InputBox("Give me some input", "Hi", 1)
    Range("A1").Value = myvalue
End Sub

 

 

MsgBox_InputBox.xlsm
0.02MB

반응형

+ Recent posts