Thursday, March 22, 2012


codeacademy, defining functions, and that is almost all

VBA

stands for Visual Basic for Applications

classes (types) of programming languages
- functional programming language (Lisp)
- logical programming languages (Prolog)
- imperative programming language (C, C++, Javascript, VBA, etc)

to gain access to VBA, Alt-F11

Immediate window lets me type commands which are immediately carried out
to access the immediate window, must press Ctrl-G
HW: try this out in VBA in Excel
? 1
 1
? "hello"
hello
? 1 + 2
 3
? 50 + 100 / 2
 100
? Len("Ryan")
 4
myFirstName = "Joshua"

? myFirstName
Joshua
lastName = "Waxman"
myFullName = myFirstName & " " & lastName
? myFullName
Joshua Waxman
? Len(myFullName)
 13
Call MsgBox("hello")
Call MsgBox("hello", vbYesNo)
number = 42
? number / 2
 21
? number Mod 10
 2
myString = "hello"
? Mid(myString, 1, 2)
he
three = Mid(myString, 1, 3)
? three
hel
? replace("coding rules", "coding", "programming")
programming rules
? UCase(myString)
HELLO
? LCase(myString)
hello
? Range("A1")
 761
Range("B1").Value = 986

No comments:

Post a Comment