Created
June 11, 2012 03:13
-
-
Save drewlesueur/2908335 to your computer and use it in GitHub Desktop.
vba (Visual Basic for Excel)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub mycro() | |
' | |
' mycro Macro | |
' | |
' Keyboard Shortcut: Ctrl+e | |
' | |
ActiveCell.FormulaR1C1 = "yo dawg" | |
Range("I9").Select | |
Dim ws As Worksheet | |
' Set ws = Sheets.Add | |
Set ws = ThisWorkbook.ActiveSheet | |
' set one value | |
ws.Range("A1").Value = "yo dawg" | |
' create variable that is list of values | |
months = Array("Jan", "Feb", "March", "April", "May") | |
ws.Range("A1:E1") = months | |
ws.Range("C2").Value = "=1+2" | |
'For i = LBound(months) To UBound(months) | |
' ws.Range("A" & (i + 1)).Value = months(i) | |
'Next | |
' theName = InputBox("Enter your name please") | |
If theName = "Drew" Then | |
' MsgBox ("please fire him") | |
Else | |
' MsgBox ("he can stay") | |
End If | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment