Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
14 Cards in this Set
- Front
- Back
VBA
|
SUB NameRange ()
formula
END SUB |
|
Running, Stepping into, Stopping Macros |
F5 = Runs Macro
F8 = Steps into Macro
STOP = add into Macro to stop operation at certain point |
|
RANGE OBJECT |
= Range (A1:C5) = "quotes if text"
|
|
Code for Range Object |
Sub InsertRange()
*numbers do not need text
|
|
CELL OBJECT |
Range(Cells(1, 1), Cells(6, 6)) = "GO AWAY"
Cells(3, 1) = 5
End Sub
*rows come first, then columns |
|
Using Range Object in conjunction with Cells |
You can type in a range object using cells
Range(Cells(1, 1), Cells(6, 6)) = "GO AWAY"
OR
A range using the exact object
Range("A1:F6") = "GO AWAY"
|
|
NAMING A RANGE |
You can name a range and use this in equation
Sub ameliasRange() Range("ameliasRange") = 47 End Sub |
|
In VBA - when excel Capitalises
|
Capitalises - this means that excel has predefined it and you can not mess with it eg date + hit enter = Date |
|
FOR & NEXT
VARIABLES = x
|
For x = 1 To 10
Cells(x, 1) = x + x * 5 [in the first column, moving down x rows] [in the second column, moving down x rows]
*loops until x = 10,calculate outcome mathimatically
|
|
FOR & NEXT |
*starting at x = 2, so that you can avoid Headers. ie It wont overwrite
* Look at the x operation, =x+1 = adds 2 to x =x+x*1 = adds =2+2*" = 5 |
|
IF & THEN |
Sub If_Next_Else()
Cells(X, 1) = Date + 2
|
|
IF & THEN & ELSE |
Sub If_Next_Else()
Cells(x, 1) = Date + 2
|
|
Other VBA Tips
Using VBA |
-Ctrl J - Brings up List Property/Methods
-Comment Block and Uncomment Block. You can comment out lines of code and and they are skipped over
-ToggleBreakpoint F9
-Object Browser F2 / F7 gets you back to code
-Property Window F4 (propertys of the worksheet) |
|
Create Message Box |
Sub Message_Box() MsgBox "Hello World!", vbOKOnly, "Howdy"
*The message, the options, the header of msg |