Introduction*to*VBA*in*Excel*
Week*1*
Hello*Students*and*welcome*to*the*VBA*programming*module*of*the*course.**
Study*items*for*this*week*
These*are*the*topics*you*should*familiarize*yourself*for*this*week:**
1. Introduction*to*VBA*–*What*is*it*and*why*do*we*need*it?**
2. Getting*started*with*VBA*–*Access*the*VBA*editor*
3. Record*a*Macro*
4. Recording*a*Macro*for*Automation*of*‘Repetitive’*Tasks*
5. Running*a*Macro*in*another*Workbook*
6. Recap**
For*each*of*these*points*we*have*mentioned*some*text,*links*to*videos,*links*to*articles,*book*
chapters* etc.* that* you* can* use* to* understand* and* practice* with.* You* are* welcome* to* look* at*
other*sources*too*for*better*understanding.*You*are*also*encouraged*to*discuss*these*with*your*
group*members*and*learn*from*each*other.**
By*the* time*we* get*to* the*lab* for*this* week*you* should*develop* a*basic*understanding*of*the*
items*listed*above.**
*
* *
1.*Introduction*to*VBA*–*What*is*it*and*why*do*we*need*it?*
1.1*What*is*VBA?*
VBA*stands*for*Visual*Basic*for*Applications.*
Applications*in*the*word*VBA*refers*to*the*different*Microsoft*programs*such*as*Excel,*
Word,*PowerPoint.*We*will*focus*on*Excel.*
VBA* is* a* tool* for* programming,* editing* and* running* application* code* of* the* host*
application*(excel).*We*will*run*its*code*within*the*host*application.**
We*can*work*on*VBA*using*the*VBA*editor*that*we*can*open*from*the*‘Developer’*tab*in*
excel*by*clicking*on*first*item*in*the*ribbon*called*‘VBA’*or*can*press*Alt+F11.**
1.2*Why*(computer)*programming?*
Useful*in*developing*problem*solving*skills*
1.3*Why*VBA?*
Useful’“add+on”’to’basic’model’development’skills’on’top’of’Excel:*You*have*seen*how*
powerful* Excel* can* be* to* carryout* different* tasks.* With* VBA,* you* can* do* many* more*
customizable*things*for*the*different*problems*you*may*be*working*on.**
Automate’ repetitive’ tasks:’ If* you* have* to* repeat* the* same* task* again* and* again,* like*
adding*the*same*headings*to*multiple*sheets*or*to*multiple*cells,*instead*of*you*typing*it*
over*and*over*again,*you*can*just*‘record*it*as*a*macro’*or*‘write*a*macro’*to*do*the*task*