Professional Documents
Culture Documents
Macros can be accessed by running the code, assigning to any shape or button or through short cuts
1) Printing Messages
Sub HelloWorld()
End Sub
Sub HelloWorld()
MsgBox "Hello" & vbCrLf & "World" & vbCrLf & "How are you?"
End Sub
'Sub NewMacro()
'
'
'
' Selection.Copy
' Selection.End(xlToLeft).Select
' Selection.End(xlUp).Select
' ActiveSheet.Paste
'End Sub
Sub LearningVariables()
Dim a As Integer
a = 25
a=a+5
name = "Harshit"
MsgBox a
MsgBox name
End Sub
Sub LearningVariables2()
MsgBox "First Name: " & fname & vbCrLf & "Last Name: " & lname & vbCrLf & "Age: " & age
End Sub