You are on page 1of 6

DAY 1

è Familiarize yourself with VBA IDE and ways to access

Q1) How to enable macros for your document?

Refer:
http://office.microsoft.com/client/helppreview.aspx?AssetID=HA100310711033&QueryID=QZiB
ZCQQ&respos=3&rt=2&ns=WINWORD&lcid=1033&pid=CH100487501033

Q.2) How to write and record a macro?

Refer:

http://office.microsoft.com/client/helppreview.aspx?AssetID=HA100997691033&QueryID
=QZiBZCQQ&respos=2&rt=2&ns=WINWORD&lcid=1033&pid=CH100970161033

Note: Remember the following shortcuts


Ø Alt + F11: To switch between office document and VBA IDE.
Ø Alt + F8: To launch the Macros DB(Containing list of all currently available macros)
Ø F5: To run a macro, when in VBA IDE.

Also refer: Book Writing Excel Macros with VBA, by Steven Roman - Part I (Pg No. 9 onwards)
(Book is Available in Zeus Library)

Q.3) What is the difference between “Step-In” and “Step-Over” within the debugger?

VBA TRAINING DOCUMENT -1


DAY 2

è Data types, Variables and Constants

Familiarize yourself with Hungarian Naming Convention.

Refer:

http://www.quepublishing.com/articles/article.asp?p=339477&seqNum=1
http://www.quepublishing.com/articles/article.asp?p=339477&seqNum=2
http://office.microsoft.com/client/helppreview.aspx?AssetID=HV012019161033&QueryID
=caiBhpQDU&respos=12&rt=2&ns=WINWORD.DEV&lcid=1033&pid=CH101327171033
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-
us/dnarofftalk/html/office08032000.asp

Control structures

Also refer Part II of Excel Macros Book. (Page No. 47- 98)

Exercise:

1. Take a “¦” (pipe) separated list of words and display each word separately.
Note: Display Output using Do…While, For…Loop and For Each…Next control
statements separately.

2. Write a menu driven program that computes factorial, prime number and Fibonacci
series of any given number.
Note: Display output using switch case and if else control statement separately.

VBA TRAINING DOCUMENT - 2


DAY 3
è VBA Object Model

Excel Object Model Overview

Refer:http://office.microsoft.com/client/helppreview.aspx?AssetID=HV102190541033&ns=EXCE
L.DEV&lcid=1033

Word Object Model Overview

Refer:http://office.microsoft.com/client/helppreview.aspx?AssetID=HV100822501033&ns=WIN
WORD.DEV&lcid=1033

Exercises:

1. Display the text and font properties (size, font-name, bold, italic, underline, text-
alignment) of used cells in the immediate window.
2. Display the text and paragraph properties (All properties available under Indents and
spacing tab in Paragraph db) for each paragraph in the immediate window.

VBA TRAINING DOCUMENT - 3


DAY 4
è VBA Object Model Continued…

PowerPoint Object Model Overview

Refer: http://msdn2.microsoft.com/en-us/library/aa213568(office.11).aspx

Access Object Model Overview

Refer:http://office.microsoft.com/client/helppreview.aspx?AssetID=HV102157031033&ns=MSA
CCESS.DEV&lcid=1033

Exercises:

1. Display the text and positioning properties (Height, width, top, left) for each shape of
each slide (Distinguish between the shapes for different slide) in the immediate window.
2. Display all the records along with field names and field properties (Data type, field size,
and Display Control) for each shape of each slide (Distinguish between the shapes for
different slide) in the immediate window.

VBA TRAINING DOCUMENT - 4


DAY 5

è Working with File System Object to read and write a text file.

Refer:
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-
us/dnarofftalk/html/office09072000.asp

Exercise:
Q.1) Write a macro that will copy the content from any excel file to a word document and create an
html for the same word document (Properties to be included in the html are font-name and size).

VBA TRAINING DOCUMENT - 5


DAY 6
è Use of dialog boxes/forms

Refer Topic:

PowerPoint Developer Reference


How to: Create UserForms

http://office.microsoft.com/client/helppreview.aspx?AssetID=HV101313521033&QueryID=gviBC
UFRm&respos=2&rt=2&ns=POWERPNT.DEV&lcid=1033&pid=CH101080831033

Exercise:
Q1) Write a macro that will accept the no. of rows, no. of columns, preferred row height, preferred
column width and content of each cell and insert a table based on the input in any of the three
applications (Word, Excel, PowerPoint). Application type should be a user input.

Q2) Write a macro that will read the table data, in PowerPoint, and display the data of all merged cells.
If no merged cell is available popup a message to the user for the same. Further copy the table to an
empty excel sheet, apply a Table Formatting Style and display the foreground and background color of
each cell in RGB format.

VBA TRAINING DOCUMENT - 6

You might also like