Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to VBA MGMI 311 19-Aug-2011. What is VBA? VBA = Visual Basic for Application Excel’s powerful built-in programming language An event-driven.

Similar presentations


Presentation on theme: "Introduction to VBA MGMI 311 19-Aug-2011. What is VBA? VBA = Visual Basic for Application Excel’s powerful built-in programming language An event-driven."— Presentation transcript:

1 Introduction to VBA MGMI 311 19-Aug-2011

2 What is VBA? VBA = Visual Basic for Application Excel’s powerful built-in programming language An event-driven language An object-based language Core macro language for all Microsoft’s office products

3 Event-driven language Nothing happens unless something happens No code executes except in response to some event taking place ( or at the command of the code once it is started by some event)

4 Object-based Language When referring to the components of the application, things like workbooks, worksheets, cells, charts, etc. are ‘objects’ An object has certain attributes Objects can do things or have thing done to them – these actions are known as ‘Methods’

5 Macro A series of commands and functions that are stored in a Microsoft Visual Basic module, and It can be run whenever you need to perform the task  Record a macro  Run a macro  Edit a macro  Stop a macro

6 Record a macro Developer Toolbar Record New Macro Input Macro Name If you want to run the macro by pressing a keyboard shortcut key, enter a letter in the Shortcut key box Click the location where you want to store the macro Once you finish the task in excel, click Stop macro ( in the toolbar)

7 Run a macro Use shortcut key At developer toolbar, click macro Choose the macro you want to perform Click Run --- OR --- Start a macro from a toolbar button

8 Stop a macro If you want to stop a macro that’s currently running, press ESC, and click End in the Microsoft Visual Basic dialog box If you want to prevent automatically running a macro when you start Microsoft Excel, hold down Shift during startup

9 Save excel –with macro Save as ‘Excel Macro-Enable Workbook’ At Developer toolbar, click ‘Macro Security’ Trust Centre window, click ‘Disable all macros with notification’ When calling an excel macro-enable workbook, click ‘Option’ Select ‘Enable this content’, on the Microsoft Office Security Option window

10 Edit a macro Developer toolbar, choose ‘Macro’ Click macro name and edit Visual Basic Editor (VBE) will be open Edit a macro, from the source code in the VBE


Download ppt "Introduction to VBA MGMI 311 19-Aug-2011. What is VBA? VBA = Visual Basic for Application Excel’s powerful built-in programming language An event-driven."

Similar presentations


Ads by Google