SlideShare a Scribd company logo
VISUAL BASIC FOR
APPLICATIONS WITH
EXCEL

1
To install or enable VBA:












1.Double-click the Add/Remove Programs icon in the Microsoft Windows Control Panel
(found on the Start menu).
2.If you installed Excel as part of Microsoft Office, click Microsoft Office (edition and
version)
3.In the currently installed programs box, and then click the Change button. If you
installed Excel individually, click Excel (edition and version) in the currently installed
programs box, and then click the Change button.
4. On the installation options screen in the Setup program, click the plus sign (+)
next to Office Shared Features.
5. Select Visual Basic for Applications, click the arrow next to your selection, and then
click
6. Run from My Computer.

2












After the installation is complete, you may also need to change the macro security
setting in Excel before you can run any VBA programs. To change the macro security
setting in Excel 2007, do the following:
1. Click the Office button, and then click the Excel Options button. Click the Trust
Center button from the left-hand navigation menu, and then click the Trust Center
Settings button, which opens the Trust Center window.
2. From the Trust Center window, click the Macro Settings icon from the left-hand
navigation Menu and choose the Disable All Macros with Notification option.
3.After the installation is complete, you may also need to change the macro security
setting in excel before you can run any VBA programs. To change the macro
security setting in Excel 2007, do the following:
5. Click the Office button, and then click the Excel Options button. Click the Trust
Center button from the left-hand navigation menu, and then click the Trust Center
Settings button, which opens the Trust Center window.
6. From the Trust Center window, click the Macro Settings icon from the left-hand
navigation Menu and choose the Disable All Macros with Notification option.

3






The VBA development software is included with each component of the Microsoft Office
suite of programs, including Excel. Starting the VBA development software places you in
the VBA programming environment IDE
Getting to the IDE from Excel :
IDE can be acced from Excel through the keystroke Alt + F11 or via the Developer tab
located in the Excel Ribbon as shown in Figure



Microsoft Office button



Launch the Visual Basic Editor

The Ribbon
Accessing the VBA
IDE from the
Ribbon’s
Developer tab.

4






If you do not see the Developer tab in the Ribbon, you will need to change an Excel
option by completing the next set of steps.
1. Click the Office button, and then click the Excel Options icon.
2. Click the Popular icon from the left-hand navigation menu and choose Show
Developer.

5
The menu bar

The Project Explorer window

The Standard
toolbar

An Object
Code window
The Properties
window

Figure 1.3 shows that there is currently one project, called
Book1, open, and that this project contains four Excel objects:
Sheet1, Sheet2, Sheet3, and This Workbook
6
The Sheet1
selection

The Name
property

7
An edited
worksheet name
in Excel.

8
Working with
Form and ActiveX
controls.

9
Manage control
properties
while in Design
Mode

The Command Button control placed on
a worksheet.
10
Click to access the Properties window

Displays the selected
control’s properties

11
The Object
List

The Procedure List

The
Editor

12

More Related Content

PPTX
Module 9-Giving feedback and grade-Task 1
EDIT3318
 
PPTX
Introduction To Excel 2007 Macros
Excel
 
PPTX
Intro macros in Excel 2007
Hasrudin Tazep
 
PPTX
Microsoft Excel Spin Button
Excel Advise
 
PDF
Hello World e4 Application Part 3
Annamalai Chockalingam
 
PPTX
Outlook’s crashing with exception code
P News
 
PDF
Introduction
شكسبير ويليام
 
PPTX
Lesson 14 Using Templates
guevarra_2000
 
Module 9-Giving feedback and grade-Task 1
EDIT3318
 
Introduction To Excel 2007 Macros
Excel
 
Intro macros in Excel 2007
Hasrudin Tazep
 
Microsoft Excel Spin Button
Excel Advise
 
Hello World e4 Application Part 3
Annamalai Chockalingam
 
Outlook’s crashing with exception code
P News
 
Lesson 14 Using Templates
guevarra_2000
 

What's hot (20)

PDF
Tutorial 3 accessing the database
ssa_joe
 
PPTX
Creating a Microsoft Excel Macro
Lauraly DuBois
 
PPTX
Visual studio ide componects dot net framwork
Dipen Parmar
 
PPTX
Excel training commands not in ribbon
Vijay Perepa
 
PDF
Module 7: Advanced Quiz Options Task 3
Ciel Educttu
 
PDF
Module 8: Grade Center Task 1
Ciel Educttu
 
DOCX
Asp notes
hello232
 
PDF
Forgot Password to Unprotect Excel Sheet in Two Cases
Aadewea
 
PDF
Module 9: Feedback & Grade Task 1
Ciel Educttu
 
PDF
Module 6: Assignments Task 2
Ciel Educttu
 
PDF
Tips about windows 8.1 certification
Logitrain
 
PPT
Android User Interface: Basic Form Widgets
Ahsanul Karim
 
PPTX
Hello android example.
Rahul Rana
 
PPTX
Exporting data from HyperTeam CRM
HyperTeam USA Business and IT Consulting Inc.
 
PPTX
Introduction to Eikon
isc_library
 
PDF
Module 6: Assignments Task 3
Ciel Educttu
 
PPTX
Windows Store apps development
Laurent Duveau
 
PDF
Meta analysis in rev man screen captures-1
andy andy
 
PPT
Fulcrum eForm Creation Tool
kapilkantkamal
 
PDF
How to add the windows calculator to the quick access toolbar in microsoft ex...
Trường Tiền
 
Tutorial 3 accessing the database
ssa_joe
 
Creating a Microsoft Excel Macro
Lauraly DuBois
 
Visual studio ide componects dot net framwork
Dipen Parmar
 
Excel training commands not in ribbon
Vijay Perepa
 
Module 7: Advanced Quiz Options Task 3
Ciel Educttu
 
Module 8: Grade Center Task 1
Ciel Educttu
 
Asp notes
hello232
 
Forgot Password to Unprotect Excel Sheet in Two Cases
Aadewea
 
Module 9: Feedback & Grade Task 1
Ciel Educttu
 
Module 6: Assignments Task 2
Ciel Educttu
 
Tips about windows 8.1 certification
Logitrain
 
Android User Interface: Basic Form Widgets
Ahsanul Karim
 
Hello android example.
Rahul Rana
 
Exporting data from HyperTeam CRM
HyperTeam USA Business and IT Consulting Inc.
 
Introduction to Eikon
isc_library
 
Module 6: Assignments Task 3
Ciel Educttu
 
Windows Store apps development
Laurent Duveau
 
Meta analysis in rev man screen captures-1
andy andy
 
Fulcrum eForm Creation Tool
kapilkantkamal
 
How to add the windows calculator to the quick access toolbar in microsoft ex...
Trường Tiền
 
Ad

Similar to VBA (20)

PDF
Vbabook ed2
NilsonVallecillo
 
DOC
Autocad excel vba
rjg_vijay
 
PDF
INTRODUCTION TO VISUAL BASICS
Prof Ansari
 
PDF
Financial Analysis with Microsoft Excel 4th Edition Timothy R.(Timothy R. May...
fritzealoqab
 
PPTX
Excel ch10
Kristin Harrison
 
PPT
Learn Vba excel 2007
Steve Johnson
 
PDF
Mfc programming tutorial automation step by-step
namtranvanpt
 
DOCX
GEIT 3341 DATABASE I LAB 2 GEIT 3341 Database I
MatthewTennant613
 
PDF
Learn Advanced Excel Online
bigspire
 
PDF
Vba 2 (students copy)
Sherwin Keith Rivera
 
PDF
Microsoft teams employee onboarding
Parag Rege
 
DOCX
2580 microsoft excel2010_rtm_wsg_external
BrittanyShatia
 
PDF
Productivity tools
Angelito Quiambao
 
PPTX
Office 365 Productivity Tips "February Frenzy"
Christian Buckley
 
PDF
Form4 cd4
smktsj2
 
PDF
VT University Live Session 3
VisibleThread
 
PDF
guide for windows 10 - basic for begginers
vmlaluno
 
PDF
guide for windows 10 - basic for begginers
vmlaluno
 
PDF
Salesforce Integration | Outlook Sync Guide
Piper powered by Icontrol
 
PPTX
QESUTGPfbmYH3WQF257.pptx
RAMCHANDRASHARMA7
 
Vbabook ed2
NilsonVallecillo
 
Autocad excel vba
rjg_vijay
 
INTRODUCTION TO VISUAL BASICS
Prof Ansari
 
Financial Analysis with Microsoft Excel 4th Edition Timothy R.(Timothy R. May...
fritzealoqab
 
Excel ch10
Kristin Harrison
 
Learn Vba excel 2007
Steve Johnson
 
Mfc programming tutorial automation step by-step
namtranvanpt
 
GEIT 3341 DATABASE I LAB 2 GEIT 3341 Database I
MatthewTennant613
 
Learn Advanced Excel Online
bigspire
 
Vba 2 (students copy)
Sherwin Keith Rivera
 
Microsoft teams employee onboarding
Parag Rege
 
2580 microsoft excel2010_rtm_wsg_external
BrittanyShatia
 
Productivity tools
Angelito Quiambao
 
Office 365 Productivity Tips "February Frenzy"
Christian Buckley
 
Form4 cd4
smktsj2
 
VT University Live Session 3
VisibleThread
 
guide for windows 10 - basic for begginers
vmlaluno
 
guide for windows 10 - basic for begginers
vmlaluno
 
Salesforce Integration | Outlook Sync Guide
Piper powered by Icontrol
 
QESUTGPfbmYH3WQF257.pptx
RAMCHANDRASHARMA7
 
Ad

More from Raghu nath (20)

PPTX
Mongo db
Raghu nath
 
PDF
Ftp (file transfer protocol)
Raghu nath
 
PDF
MS WORD 2013
Raghu nath
 
PDF
Msword
Raghu nath
 
PDF
Ms word
Raghu nath
 
PDF
Javascript part1
Raghu nath
 
PDF
Regular expressions
Raghu nath
 
PDF
Selection sort
Raghu nath
 
PPTX
Binary search
Raghu nath
 
PPTX
JSON(JavaScript Object Notation)
Raghu nath
 
PDF
Stemming algorithms
Raghu nath
 
PPTX
Step by step guide to install dhcp role
Raghu nath
 
PPTX
Network essentials chapter 4
Raghu nath
 
PPTX
Network essentials chapter 3
Raghu nath
 
PPTX
Network essentials chapter 2
Raghu nath
 
PPTX
Network essentials - chapter 1
Raghu nath
 
PPTX
Python chapter 2
Raghu nath
 
PPTX
python chapter 1
Raghu nath
 
PPTX
Linux Shell Scripting
Raghu nath
 
PPTX
Perl
Raghu nath
 
Mongo db
Raghu nath
 
Ftp (file transfer protocol)
Raghu nath
 
MS WORD 2013
Raghu nath
 
Msword
Raghu nath
 
Ms word
Raghu nath
 
Javascript part1
Raghu nath
 
Regular expressions
Raghu nath
 
Selection sort
Raghu nath
 
Binary search
Raghu nath
 
JSON(JavaScript Object Notation)
Raghu nath
 
Stemming algorithms
Raghu nath
 
Step by step guide to install dhcp role
Raghu nath
 
Network essentials chapter 4
Raghu nath
 
Network essentials chapter 3
Raghu nath
 
Network essentials chapter 2
Raghu nath
 
Network essentials - chapter 1
Raghu nath
 
Python chapter 2
Raghu nath
 
python chapter 1
Raghu nath
 
Linux Shell Scripting
Raghu nath
 

Recently uploaded (20)

PDF
Tran Quoc Bao named in Fortune - Asia Healthcare Leadership Index 2025
Gorman Bain Capital
 
PPTX
Avoid These Costly Blunders_ Critical Mistakes When Selecting CA Services in ...
Sachin Gujar & Associates
 
PPTX
creation economic value Chapter 2 - PPT.pptx
ahmed5156
 
PDF
2025 Mid-year Budget Review_SPEECH_FINAL_23ndJuly2025_v5.pdf
JeorgeWilsonKingson1
 
PPTX
Accounting for liabilities stockholderss
Adugna37
 
PPT
TA- C-7 MACD, VWAP, STREND.ppttttttttttt
AnubhavBatra2
 
PDF
An Uncut Conversation With Gemini | PDF Document
Mike Hydes
 
PDF
European Exchange Report 2024 - FESE Statistics
secretariat4
 
PPTX
Session 1 FTP 2023 25th June 25 TRADE FINANCE
NarinderKumarBhasin
 
PDF
The Future of Electricity Pricing in South Africa by Matthews Mooketsane Bant...
Matthews Bantsijang
 
PPTX
d and f block elements chapter 4 in class 12
dynamicplays04
 
PPTX
H1 2025 review - a review of our trade recommendations for H1 2025
Mathias Lascar
 
PDF
Joseph Patrick Roop - Roth IRAs: Weighing the Pros and Cons
Joseph Roop
 
PDF
Cryptocurrency Wallet Security Protecting Your Digital Assets.pdf
Kabir Singh
 
PDF
Asia’s Top 10 Hospital CEOs Transforming Healthcare in 2025
Gorman Bain Capital
 
PDF
Abhay Bhutada’s Contribution to Learning and Progress
Lokesh Agrawal
 
PDF
[Cameron] Robust Inference for Regression with Clustered Data - slides (2015)...
soarnagi1
 
PPTX
Accounting for fixed ASSETS AND INTANGIBLE ASSETS
Adugna37
 
PPTX
Scalping_vs_Swing_Core_Differences.at a glance pptx
Telegram Signal Copier
 
PPTX
PUrposive-commmunicatuon112uospptxyynsns
yunaselle7
 
Tran Quoc Bao named in Fortune - Asia Healthcare Leadership Index 2025
Gorman Bain Capital
 
Avoid These Costly Blunders_ Critical Mistakes When Selecting CA Services in ...
Sachin Gujar & Associates
 
creation economic value Chapter 2 - PPT.pptx
ahmed5156
 
2025 Mid-year Budget Review_SPEECH_FINAL_23ndJuly2025_v5.pdf
JeorgeWilsonKingson1
 
Accounting for liabilities stockholderss
Adugna37
 
TA- C-7 MACD, VWAP, STREND.ppttttttttttt
AnubhavBatra2
 
An Uncut Conversation With Gemini | PDF Document
Mike Hydes
 
European Exchange Report 2024 - FESE Statistics
secretariat4
 
Session 1 FTP 2023 25th June 25 TRADE FINANCE
NarinderKumarBhasin
 
The Future of Electricity Pricing in South Africa by Matthews Mooketsane Bant...
Matthews Bantsijang
 
d and f block elements chapter 4 in class 12
dynamicplays04
 
H1 2025 review - a review of our trade recommendations for H1 2025
Mathias Lascar
 
Joseph Patrick Roop - Roth IRAs: Weighing the Pros and Cons
Joseph Roop
 
Cryptocurrency Wallet Security Protecting Your Digital Assets.pdf
Kabir Singh
 
Asia’s Top 10 Hospital CEOs Transforming Healthcare in 2025
Gorman Bain Capital
 
Abhay Bhutada’s Contribution to Learning and Progress
Lokesh Agrawal
 
[Cameron] Robust Inference for Regression with Clustered Data - slides (2015)...
soarnagi1
 
Accounting for fixed ASSETS AND INTANGIBLE ASSETS
Adugna37
 
Scalping_vs_Swing_Core_Differences.at a glance pptx
Telegram Signal Copier
 
PUrposive-commmunicatuon112uospptxyynsns
yunaselle7
 

VBA

  • 2. To install or enable VBA:       1.Double-click the Add/Remove Programs icon in the Microsoft Windows Control Panel (found on the Start menu). 2.If you installed Excel as part of Microsoft Office, click Microsoft Office (edition and version) 3.In the currently installed programs box, and then click the Change button. If you installed Excel individually, click Excel (edition and version) in the currently installed programs box, and then click the Change button. 4. On the installation options screen in the Setup program, click the plus sign (+) next to Office Shared Features. 5. Select Visual Basic for Applications, click the arrow next to your selection, and then click 6. Run from My Computer. 2
  • 3.       After the installation is complete, you may also need to change the macro security setting in Excel before you can run any VBA programs. To change the macro security setting in Excel 2007, do the following: 1. Click the Office button, and then click the Excel Options button. Click the Trust Center button from the left-hand navigation menu, and then click the Trust Center Settings button, which opens the Trust Center window. 2. From the Trust Center window, click the Macro Settings icon from the left-hand navigation Menu and choose the Disable All Macros with Notification option. 3.After the installation is complete, you may also need to change the macro security setting in excel before you can run any VBA programs. To change the macro security setting in Excel 2007, do the following: 5. Click the Office button, and then click the Excel Options button. Click the Trust Center button from the left-hand navigation menu, and then click the Trust Center Settings button, which opens the Trust Center window. 6. From the Trust Center window, click the Macro Settings icon from the left-hand navigation Menu and choose the Disable All Macros with Notification option. 3
  • 4.    The VBA development software is included with each component of the Microsoft Office suite of programs, including Excel. Starting the VBA development software places you in the VBA programming environment IDE Getting to the IDE from Excel : IDE can be acced from Excel through the keystroke Alt + F11 or via the Developer tab located in the Excel Ribbon as shown in Figure  Microsoft Office button  Launch the Visual Basic Editor The Ribbon Accessing the VBA IDE from the Ribbon’s Developer tab. 4
  • 5.    If you do not see the Developer tab in the Ribbon, you will need to change an Excel option by completing the next set of steps. 1. Click the Office button, and then click the Excel Options icon. 2. Click the Popular icon from the left-hand navigation menu and choose Show Developer. 5
  • 6. The menu bar The Project Explorer window The Standard toolbar An Object Code window The Properties window Figure 1.3 shows that there is currently one project, called Book1, open, and that this project contains four Excel objects: Sheet1, Sheet2, Sheet3, and This Workbook 6
  • 9. Working with Form and ActiveX controls. 9
  • 10. Manage control properties while in Design Mode The Command Button control placed on a worksheet. 10
  • 11. Click to access the Properties window Displays the selected control’s properties 11
  • 12. The Object List The Procedure List The Editor 12