EXCEL VBA Step-by-Step GuideTo Learning Excel Programming Language For Beginners ( PDF )
《EXCEL VBA Step-by-Step GuideTo Learning Excel Programming Language For Beginners ( PDF )》由会员分享,可在线阅读,更多相关《EXCEL VBA Step-by-Step GuideTo Learning Excel Programming Language For Beginners ( PDF )(106页珍藏版)》请在凡人图书馆上搜索。
1、EXCEL VBA Step-By -Step Guide To Lea rning Ex celPro g ra mming La ng ua g e Fo r Beg inners Jaso n Jay Co p y rig h t 2 0 1 7 b y Jaso n Jay - All rig h ts reserv ed . If y o u wo u ld lik e to sh are th is b o o k with an o th er p erso n , p lease p u rch ase anad d itio n al co p y fo r each rec
2、ip ien t. Th an k y o u fo r resp ectin g th e h ard wo rk o fth is au th o r. Oth erwise, th e tran smissio n , d u p licatio n o r rep ro d u ctio n o f an y o fth e fo llo win g wo rk in clu d in g sp ecific in fo rmatio n will b e co n sid ered anilleg al act irresp ectiv e o f if it is d o n e
3、electro n ically o r in p rin t. Th is ex ten d sto creatin g a seco n d ary o r tertiary co p y o f th e wo rk o r a reco rd ed co p y an d iso n ly allo wed with ex p ress written co n sen t fro m th e Pu b lish er. All ad d itio n alrig h t reserv ed .TABLE OF CONTENTEXCEL VBA 1In tro d u ctio n
4、5CHAPTER 1 7 VBA Dev elo p er TAB 7Accesin g to th e Dev elo p er TAB 7Qu iz 1 8CHAPTER 2 9 Macro s 9Creatin g a Macro 9Relativ e Referen ces 1 1Ru n n in g th e Macro 1 2Sav in g a Macro -En ab led Wo rk b o o k 1 2Qu iz 2 1 4CHAPTER 3 1 6 Startin g with VBA 1 6Wh at if I n eed to fill th e cells u
5、 p to 1 0 0 ? 1 9In sert Fo rm Bu tto n 2 1Simp le th in g s a Macro can t d o . 2 2In sert Activ eX Bu tto n 2 2Variab les, Do an d Lo o p . 2 3Wh at is th e ad v an tag e o f d eclarin g v ariab les as b y te, in teg er o r an y o th er? 3 1APPs Perfo rman ce 3 5MSGBOX 3 9If an d Select Case 4 0Qu
6、 iz 3 4 3CHAPTER 4 4 5Pro ject: Creatin g a Simp le Calcu lato r u sin g Activ eX 4 5Wh at is a Mo d u le? 4 5Ho w to create a Mo d u le 4 6Ad d in g Letters? 5 8Qu iz 4 5 9CHAPTER 5 6 0Pro ject: Calcu lato r u sin g Fo rms 6 0Rev iew 6 0FORMS 6 1Co mmman d Bu tto n s co d e 6 5Ex cel Fo rmu las o n
7、 VBA 7 4Co mb in in g VBA an d a Sp read sh eet 7 5Startin g with Declaratio n s: 7 8Op en an d Clo se d eclaratio n s: Disp lay in g a fo rm with o u t lo o k in g an y sp read sh eet 8 1Macro Secu rity 8 7Co mmen ts 8 9Th e wh o le co d e fo r Calcu lato r Pro ject 9 4Co mman d Bu tto n s Ord er 1
8、 0 1Ad d in g Passwo rd to VBA Co d e. 1 0 2Qu iz 5 1 0 4In teractin g with o th er Ap p licatio n s. 1 0 5Op en in g o th er ap p s fro m Ex cel 1 0 5Sen d in g an Ou tlo o k e-mail fro m Ex cel: 1 0 8Ex ercises So lu tio n s: 1 1 1An swers Ch ap ter 1 1 1 1An swers Ch ap ter 2 1 1 2An swers Ch ap
9、ter 3 1 1 3An swers Ch ap ter 4 1 1 4An swers Ch ap ter 5 1 1 5 Intro ductio n If y o u alread y k n o w h o w to u se Micro so ft Ex cel b u t th erere a fewth in g s y o u can t d o , it is time to learn th e stro n g est fu n ctio n ality it h as, Visu alBasic fo r Ap p licatio n s (VBA).Visu al
10、Basic fo r Ap p licatio n s is a p ro g rammin g lan g u ag e in co rp o ratedin Micro so ft Ex cel, Access, Po werPo in t an d ev en Wo rd , wh ich let y o u d o allth in g s y o u alread y k n o w ab o u t th em an d mu ch mo re. Fo r ex amp le, y o u wan tth at ev ery time y o u o p en a sp ecifi
11、c Micro so ft Wo rd file it writesau to matically th e cu rren t d ate two lin es b elo w wh ere y o u left last time. Ormay b e y o u wan t a wh o le sp read sh eet o f Ex cel with o u t fo rmu las o n it an d stillap p ly in g th em as if th ey were th ere. Ho w wo u ld y o u d o th at? All th ese
12、 th in g san d mu ch mo re are d o n e with Visu al Basic fo r Ap p licatio n s fo r Micro so ftOffice.Lo o k at th e ex amp le b elo w:It lo o k s lik e a p ro g ram mad e fo r an aly sis, an d it d o es. Gu ess wh atp ro g ram it is? Pro b ab ly y o u are th in k in g it is n o t an y Micro so ft
13、Officep ro g ram, b u t let me tell y o u th at it was mad e with Micro so ft Ex cel, h o wwo u ld y o u d o so meth in g lik e th at with o u t p ro g rammin g ? Th eres n o way !Yo u ll learn mu ch mo re th an th at an d will b e ab le to create y o u r o wnp ro g rams u sin g Visu al Basic fo r A
14、p p licatio n s (VBA).If y o u n eed a v ery sp ecific p ro g ram fo r y o u r b u sin ess an aly sis,so meth in g fo r p erso n al u se, o r ev en ju st fo r h av in g fu n , y o u n eed Visu alBasic fo r Ap p licatio n s n o w! CHAPTER 1VBA Dev elo per TAB Ev ery p ro g rammin g lan g u ag e h as
15、similarities b etween th eirfu n d amen tals. Th e fu n ctio n s IF, Th en , Lo o p , Clo se, Op en , are ju st so me o fth em. Well learn th e b asic o n es first; it will b e n ecessary to u n d erstan d h o wVBA wo rk s.Well u se Micro so ft Ex cel 3 6 5 fo r th is in stru ctio n s an d ex amp le
16、s, h o wev er,fro m Micro so ft Ex cel 2 0 0 7 o n ward s it will wo rk th e same.Accesing to the Dev elo per TAB Micro so ft Ex cel d o esn t sh o w th e Dev elo p er TAB b y d efau lt. It o n ly h asFile, Ho me, In sert, etc. Bu t th eres n o o n e called Dev elo p er. To access to th isTAB th ere
17、 are d ifferen t o p tio n s, b u t well sh o w th e easiest o n e.1 . Rig h t click to th e Rib b o n (an y p art in sid e th e red b o x , ex cep t th eb u tto n s). 2 . Select Cu sto mize th e Rib b o n 3 . En ab le th e Dev elo p er ch eck b o x an d click th e OK b u tto n .4 . Yo u sh o u ld s
18、ee th e Dev elo p er TAB av ailab le n o w. Quiz 1 1 . Ho w y o u Access the Dev elo per TAB?a) It is av ailab le b y d efau lt in Ex cel.b ) Rig h t click o n th e Rib b o n , Cu sto mize th e Rib b o n , en ab le th eCh eck b o x fo r Dev elo p er an d Accep t.c) Go to file, Op tio n s, Ad v an ce
19、d an d En ab le th e Dev elo p er TAB. CHAPTER 2Ma cro s Crea ting a Ma croYo u ll see a few o p tio n s av ailab le in th e Dev elo p er TAB, b y n o w well startto u se th e Reco rd Ma cro b u tto n .A Macro is an au to mated seq u en ce wh ich will ap p ly ev ery time y o u p lay it.Lets see a p
20、ractical ex amp le o f it:Imag in e th at in y o u r jo b y o u d o th e same p ro cess ev ery mo rn in g . It tak esso me v alu ab le time an d ev en y o u re g ettin g b o red o f th at.Th e p ro cess is th e fo llo win g :a) Yo u receiv e a Micro so ft Ex cel file fro m y o u r b o ss with so me
21、d ataan d y o u n eed to write th e d ate u sin g Year, Mo n th an d Day in d ifferen tco lu mn s. Yo u d o th is b ecau se it is th e fo rmat y o u r jo b n eed s an d y o u v e b een ad d in gth e same v alu es ev ery d ay fo r a few y ears. In th is case an semi-au to mated p ro cess wo u ld b e
22、h elp fu l. Ex cel g iv es th ato p tio n to all o f u s with Macro s. A Macro is a semi-au to mated p ro cess wh ichlet y o u ru n a sp ecific task u sin g a sh o rtcu t.To create a Macro , fo llo w th e seq u en ce b elo w:a) Click th e Reco rd a Macro Bu tto n .b ) Write a n ame fo r y o u r Macr
23、o . (Need ed )c) A sh o rtk ey wh ich ev ery time y o u p ress will Ru n th e Macro . Becarefu l, d o n t ad d Ctrl + C o r Ctrl + v , o th erwise it wo n t co p y o r p astean y mo re, b u t ru n th e Macro . In case y o u wan t a mo re sp ecific sh o rtcu t,h o ld th e sh ift k ey as y o u p ress
24、a letter. Fo r ex amp le, ctrl + sh ift + c. Tomak e it wo rk , d o n t p ress ctrl as y o u ad d a sh o rt cu t. (Op tio n al)d ) Sto re Macro in : Perso n al wo rk b o o k : Will b e av ailab le fo r all th efiles y o u o p en with Ex cel o n th at co mp u ter; New Wo rk b o o k will b eav ailab l
25、e fo r a n ew file o n ly . Th is wo rk b o o k , will ap p ly o n ly to th ecu rren t o p en file. (Need ed to ch o o se o n e)e) Write a d escrip tio n ab o u t wh at th at Macro d o es. (Op tio n al)f) Click Ok . g ) Start d o in g ev ery th in g y o u alway s d o , wh ich wo u ld b e ad d in g t



- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- EXCEL VBA Step-by-Step Guide To Learning Programming Language For Beginners PDF Step by

链接地址:https://www.stdlibrary.com/p-3186728.html