Download presentation
Presentation is loading. Please wait.
Published byTabitha Small Modified over 9 years ago
1
Basics 2
2
Write a macro that … … uses a popup message box to say Hello. (msgbox ”Hello”) … writes the contents of the active cell in a message box. (you need: msgbox …; activecell.value) … fills the selection with your name. (selection.value…) … fills the selection with the contents of cell A1! (range(”A1”).value)
3
Write a macro that … … displays the active workbooks name in a message box. … puts the workbooks name in the active cell. … copies contents of the active cell to the one under it. … displays the active cells value multiplied by 100 in a message box. … multiplies the active cell by 100 (in place).
4
Write a macro that … … multiplies the active cell by the cell on the left, and puts the results into the cell on the right. Same as above, but this time, display the results in a message box. … gives a warning in a message box about deleting cell contents, then deletes the contents of the active cell. … deletes contents from the selection, then changes the background colours to red.
5
Branching If statement Then True part; Commands if statement is true Else False part; Commands in case statement is false End if If statement1 Then True part1; ElseIf stmnt2 Then True part2; ElseIf stmnt3 Then True part3; Else False part; End if
6
Exercises for IF conditions If active cell is empty, change its colour to red. If the number in the active cell is >10, clear it. If active cell is < 10, add 1, else clear it. If active cell is negative, change its colour to red, else make it green.
7
Exercises for IF conditions Write a macro that tells us in a message box if the active cell is greater then the one to the right, or not. Write a macro that tells us in a message box if the active cell is greater than, less than or equal to the one to the right.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.