Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

Private Sub CommandButton1_Click()

//
MsgBox "This is fun"

Range("A7").Value = "14"

MsgBox "Entered value is " & Range("A7").Value

MsgBox "Entered value is 24"

MsgBox "Line 1" & vbNewLine & "Line 2"

///

Dim answer As Integer

answer = MsgBox("Are you sure you want to empty the sheet?", vbYesNo + vbQuestion,
"Hello")

If answer = vbYes Then


Cells.ClearContents
Else
'do nothing
End If

//

Dim myValue As Variant

myValue = InputBox("Give me some input", "Hi", 1)

Range("A1").Value = myValue

///

Dim temp As Double

temp = Range("A1").Value

Range("A1").Value = Range("B1").Value

Range("B1").Value = temp

//

Private Sub CommandButton1_Click()

Dim Pass As Variant


Pass = Application.InputBox("Enter Password", "Password Protected")

Select Case Pass

Case Is = False
'Do Nothing

Case Is = "test"

MsgBox "Cha gya Cheetay"

Case Else

MsgBox "Ghalat"

End Select

End Sub
//

You might also like