Professional Documents
Culture Documents
Italics
J
K
L
M
Create
Hyperlink
Create a
Table
Paste
Close
W Workbook
X
Y
Z
Cut
Repeat or
Redo
Undo
We can use the If else condition, For loop and Do loop while
programming in VBA.
Different ways of carrying out a Do loop condition in a macro until
a cell containing no data is reached:
Do While ActiveCell <> . Loop
Do Until IsEmpty(Active Cell) .. Loop
To give a macro even more flexibility, we can introduce the idea
of an interactive macro i.e. a macro that pauses and asks for
input from a user.
We can check if the macro is working properly by making use of
the Step mode wherein the code moves one line at a time
performing the corresponding actions on the worksheet. This
option can be found in Debug> Step Into. We can press F8 to
move through each line of code and Ctrl + Shift + F8 to move
out of the Step mode.
We can create individual macros for separate tasks and then
combine them into a single macro. Often times, this involves just
copying and pasting the macros into a single macro. But at times,
it requires certain modifications to be done.