SlideShare a Scribd company logo
1 of 19
Introduction to Microsoft Excel 2007 Macros
Contents Introduction to Macro Introduction to Visual Basic for Application Recording a Macro Looking at the code of Recorded Macro
Introduction to Visual Basic for Application Microsoft Excel 2007 in itself a tool which helps users to work with worksheets & workbooks with ease.   This tool is one of the ultimate timesaver, but there are numerous events when you have to do repetitive tasks which are of a very little value but consume your precious time; yet engage you in a less productive activity, which Excel may do automatically.   Microsoft Excel 2007 macro is the feature which eliminates or at-least minimize these events which take your precious time in repetitive tasks, and you will be able to capitalize this time in more productive & strategic activities.
Introduction to Visual Basic for Application - cont
 Apart from automating repetitive tasks Microsoft Excel Macros may also be used to create user interfaces User interfaces are screens where user can give inputs with ease also it enables input validations
Introduction to Visual Basic for Application - cont
 What is Visual Basic?Visual Basic is a language which is inherited from a very popular language BASIC. BASIC stands for Beginners All-purpose Symbolic Instruction Code. Visual Basic is called visual as you can do most of the program by click and go i.e. visually.  It’s an event driven & object based language. What is Event Driven Language?When we say event driven it means that you can write triggers which will initiate on specific events for example when user opens any document or saves any document What is Object Based Language?Object based language is language in which we can use objects & their properties i.e. we can use the Worksheet object and its property SheetName when some one clicks on a button
Introduction to Visual Basic for Application - cont
 Visual Basic for ApplicationVisual Basic for Application is called VBA as it uses Visual Basic language and is capable of using application specific objects i.e. if we talk about VBA for Excel it can use Cell Object, Range Object, Worksheet Object, Workbook Object etc.
Recording your first Macro Microsoft Excel 2007 provides you a very helpful option which enables you to record a macro and also modify and run afterwards Microsoft Excel 2007 don’t provide you the macro recording option by default for enabling macro recording at first you need to enable the Developer Tab, next slide defines step by step procedure to enable Developer Tab
Enabling the Developer Tab Click on Office Button Click on Excel Options On Popular Tab checkShow Developer tab inRibbon
Enabling the Developer Tab Once you are done with the process you will have the Developer Tab ready
Recording your first Macro When you record macro Microsoft Excel 2007 provides you with 2 options either you can record a macro using Absolute References or Relative References If you go for Absolute References Excel’s behavior will be: You record a macro in Cell A1 type “Excel is Great” format Bold Cell B1 Whenever you play / run this macro Excel will always type “Excel is Great” in Cell A1 and format Bold Cell B1 no matter wherever your cursor is
Recording your first Macro You can refer to following tab that you can click on Use Relative References which will enable you to record a macro in relative cells, as discussed whenever a relative reference macro is executed it will run in-place
Recording your first Macro Click Developer Tab Click on Use Relative Reference Click on Record Macro 1 3 2
Recording your first Macro As soon as you press record macro button the following screen will appear In the Macro name boxyou have to type the nameof macro In Shortcut key you can typeshort cut key which invokethe Macro Store macro (will discussedlater) You can also provide description of the macro
Recording your first Macro As soon as you press OK in the previous dialog box two things happens first record macro button changesto Stop Recording Secondly Excel starts lookingfor your action and will recordthe same Please follow steps on the following slide to complete recording
Recording your first Macro Click on Cell A1 type “Excel is Great” Select cells from A1:C1 click on Home Tab and click on Merge & Center  Press Bold & Italics Now click on Developer Tab and click on Stop recording
Playing your Macro You can execute the macro you just recorded by either clicking on the Macro button on the Developer Tab or by pressing Alt F8 , you can see the list of Recorded macros in the dialog box you can press Run buttonto execute the macro as soonas you press run you can seethat your recorded macro willexecute
Behind the scenes To see what Excel did behind the scenes you can either click on Macros button on Developer Tab and select Edit or you can press Alt F11
What it looks like This is what Excel did behind the scenes, it written the code for you.  You can change the code if you want.  You can either closethe window or pressAlt F11 again to goback to your Excelnormal screen
Conclusion Macros are used to automate tasks or you can use macros to develop user interfaces Excel Macro use a language called VBA (Visual Basic for Applications), which is both Event Driven and Object Based The easiest way to look at macro is by using the Excel’s record Macro Feature You can even edit Excel’s recorded macro by yourself Soon we will publish a presentation which will guide you on how to write your own macro Please visit www.exceladvise.com For more on Excel Functions Please comment if you like it, or have any suggestions. 19 Photo Courtesy – www.freedigitalphotos.net

More Related Content

What's hot

03 Excel formulas and functions
03 Excel formulas and functions03 Excel formulas and functions
03 Excel formulas and functions
Buffalo Seminary
 
Excel functions formulas
Excel functions formulasExcel functions formulas
Excel functions formulas
LearnIT@UD
 

What's hot (20)

Ms excel
Ms excelMs excel
Ms excel
 
Microsoft Excel - Macros
Microsoft Excel - MacrosMicrosoft Excel - Macros
Microsoft Excel - Macros
 
03 Excel formulas and functions
03 Excel formulas and functions03 Excel formulas and functions
03 Excel formulas and functions
 
Learn Excel Macro
Learn Excel Macro  Learn Excel Macro
Learn Excel Macro
 
Introduction of Advance Excel
Introduction of Advance ExcelIntroduction of Advance Excel
Introduction of Advance Excel
 
Online Advance Excel & VBA Training in India
 Online Advance Excel & VBA Training in India Online Advance Excel & VBA Training in India
Online Advance Excel & VBA Training in India
 
Advance excel
Advance excelAdvance excel
Advance excel
 
Advanced Excel ppt
Advanced Excel pptAdvanced Excel ppt
Advanced Excel ppt
 
Introduction to Excel VBA/Macros
Introduction to Excel VBA/MacrosIntroduction to Excel VBA/Macros
Introduction to Excel VBA/Macros
 
Creating a Microsoft Excel Macro
Creating a Microsoft Excel MacroCreating a Microsoft Excel Macro
Creating a Microsoft Excel Macro
 
Excel training
Excel trainingExcel training
Excel training
 
Excel VBA programming basics
Excel VBA programming basicsExcel VBA programming basics
Excel VBA programming basics
 
03.names and ranges
03.names and ranges03.names and ranges
03.names and ranges
 
Advance Tally Erp With Accounts By SK Singh
Advance Tally Erp With Accounts By SK SinghAdvance Tally Erp With Accounts By SK Singh
Advance Tally Erp With Accounts By SK Singh
 
Vba introduction
Vba introductionVba introduction
Vba introduction
 
Excel functions formulas
Excel functions formulasExcel functions formulas
Excel functions formulas
 
E learning excel vba programming lesson 1
E learning excel vba programming  lesson 1E learning excel vba programming  lesson 1
E learning excel vba programming lesson 1
 
Basic Ms excel
Basic Ms excelBasic Ms excel
Basic Ms excel
 
Ms excel ppt presentation
Ms excel ppt presentationMs excel ppt presentation
Ms excel ppt presentation
 
Tally ERP 9 ppt.
Tally ERP 9 ppt.Tally ERP 9 ppt.
Tally ERP 9 ppt.
 

Viewers also liked (7)

Excel DATEDIFF Function
Excel DATEDIFF FunctionExcel DATEDIFF Function
Excel DATEDIFF Function
 
Ms excel
Ms excelMs excel
Ms excel
 
MS Excel Training(Basic)
MS Excel Training(Basic)MS Excel Training(Basic)
MS Excel Training(Basic)
 
Corporate Social Responsibility- Microsoft Corporation
Corporate Social Responsibility- Microsoft CorporationCorporate Social Responsibility- Microsoft Corporation
Corporate Social Responsibility- Microsoft Corporation
 
Excel 2007 (formula)
Excel 2007 (formula)Excel 2007 (formula)
Excel 2007 (formula)
 
Microsoft Excel Basics
Microsoft Excel BasicsMicrosoft Excel Basics
Microsoft Excel Basics
 
Functions and formulas of ms excel
Functions and formulas of ms excelFunctions and formulas of ms excel
Functions and formulas of ms excel
 

Similar to Introduction To Excel 2007 Macros

Intro macros in Excel 2007
Intro macros in Excel 2007Intro macros in Excel 2007
Intro macros in Excel 2007
Hasrudin Tazep
 
VBA
VBAVBA
VBA
Tekish
 
Apress.migrating.to.windows.phone.dec.2011
Apress.migrating.to.windows.phone.dec.2011Apress.migrating.to.windows.phone.dec.2011
Apress.migrating.to.windows.phone.dec.2011
gautamkumar048
 
Autocad excel vba
Autocad excel vbaAutocad excel vba
Autocad excel vba
rjg_vijay
 
Chapter 01
Chapter 01Chapter 01
Chapter 01
Terry Yoast
 
0403-excel-macros-made-easy.pdf
0403-excel-macros-made-easy.pdf0403-excel-macros-made-easy.pdf
0403-excel-macros-made-easy.pdf
ABHISHEK MALIK
 
Lab jam websphere message broker labs
Lab jam   websphere message broker labsLab jam   websphere message broker labs
Lab jam websphere message broker labs
Eng Binary
 

Similar to Introduction To Excel 2007 Macros (20)

Intro macros in Excel 2007
Intro macros in Excel 2007Intro macros in Excel 2007
Intro macros in Excel 2007
 
VBA
VBAVBA
VBA
 
Excel 2007 Unit I
Excel 2007 Unit IExcel 2007 Unit I
Excel 2007 Unit I
 
Excel vba
Excel vbaExcel vba
Excel vba
 
Vbabook ed2
Vbabook ed2Vbabook ed2
Vbabook ed2
 
Apress.migrating.to.windows.phone.dec.2011
Apress.migrating.to.windows.phone.dec.2011Apress.migrating.to.windows.phone.dec.2011
Apress.migrating.to.windows.phone.dec.2011
 
Notacd04
Notacd04Notacd04
Notacd04
 
Notacd04
Notacd04Notacd04
Notacd04
 
Excel Vba Basic Tutorial 1
Excel Vba Basic Tutorial 1Excel Vba Basic Tutorial 1
Excel Vba Basic Tutorial 1
 
Autocad excel vba
Autocad excel vbaAutocad excel vba
Autocad excel vba
 
Vba 2 (students copy)
Vba 2 (students copy)Vba 2 (students copy)
Vba 2 (students copy)
 
Chapter 01
Chapter 01Chapter 01
Chapter 01
 
Creating reports in oracle e business suite using xml publisher
Creating reports in oracle e business suite using xml publisherCreating reports in oracle e business suite using xml publisher
Creating reports in oracle e business suite using xml publisher
 
Excel chapter-7
Excel chapter-7Excel chapter-7
Excel chapter-7
 
Top 20 Tips for Office 365 Productivity
Top 20 Tips for Office 365 ProductivityTop 20 Tips for Office 365 Productivity
Top 20 Tips for Office 365 Productivity
 
UNIT I.pptx
UNIT I.pptxUNIT I.pptx
UNIT I.pptx
 
Getting started with the visual basic editor
Getting started with the visual basic editorGetting started with the visual basic editor
Getting started with the visual basic editor
 
0403-excel-macros-made-easy.pdf
0403-excel-macros-made-easy.pdf0403-excel-macros-made-easy.pdf
0403-excel-macros-made-easy.pdf
 
Lab jam websphere message broker labs
Lab jam   websphere message broker labsLab jam   websphere message broker labs
Lab jam websphere message broker labs
 
Excel 2007 Unit P
Excel 2007 Unit PExcel 2007 Unit P
Excel 2007 Unit P
 

More from Excel

More from Excel (9)

Causes of Financial Model Errors
Causes of Financial Model ErrorsCauses of Financial Model Errors
Causes of Financial Model Errors
 
Spreadsheet risks & mitigation
Spreadsheet risks & mitigationSpreadsheet risks & mitigation
Spreadsheet risks & mitigation
 
Top 12 gestures if a person is lying
Top 12 gestures if a person is lyingTop 12 gestures if a person is lying
Top 12 gestures if a person is lying
 
Microsoft Excel 2007, things you should KNOW
Microsoft Excel 2007, things you should KNOWMicrosoft Excel 2007, things you should KNOW
Microsoft Excel 2007, things you should KNOW
 
Excel DAYS360 Function
Excel DAYS360 FunctionExcel DAYS360 Function
Excel DAYS360 Function
 
Microsoft Excel 2010 Sparklines
Microsoft Excel 2010 SparklinesMicrosoft Excel 2010 Sparklines
Microsoft Excel 2010 Sparklines
 
Excel SUMIFS Function
Excel SUMIFS FunctionExcel SUMIFS Function
Excel SUMIFS Function
 
Using Multiple Workbooks & Consolidation in Microsoft Excel
Using Multiple Workbooks & Consolidation in Microsoft ExcelUsing Multiple Workbooks & Consolidation in Microsoft Excel
Using Multiple Workbooks & Consolidation in Microsoft Excel
 
Microsoft Excel VLOOKUP Function
Microsoft Excel VLOOKUP FunctionMicrosoft Excel VLOOKUP Function
Microsoft Excel VLOOKUP Function
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 

Introduction To Excel 2007 Macros

  • 1. Introduction to Microsoft Excel 2007 Macros
  • 2. Contents Introduction to Macro Introduction to Visual Basic for Application Recording a Macro Looking at the code of Recorded Macro
  • 3. Introduction to Visual Basic for Application Microsoft Excel 2007 in itself a tool which helps users to work with worksheets & workbooks with ease. This tool is one of the ultimate timesaver, but there are numerous events when you have to do repetitive tasks which are of a very little value but consume your precious time; yet engage you in a less productive activity, which Excel may do automatically. Microsoft Excel 2007 macro is the feature which eliminates or at-least minimize these events which take your precious time in repetitive tasks, and you will be able to capitalize this time in more productive & strategic activities.
  • 4. Introduction to Visual Basic for Application - cont
 Apart from automating repetitive tasks Microsoft Excel Macros may also be used to create user interfaces User interfaces are screens where user can give inputs with ease also it enables input validations
  • 5. Introduction to Visual Basic for Application - cont
 What is Visual Basic?Visual Basic is a language which is inherited from a very popular language BASIC. BASIC stands for Beginners All-purpose Symbolic Instruction Code. Visual Basic is called visual as you can do most of the program by click and go i.e. visually. It’s an event driven & object based language. What is Event Driven Language?When we say event driven it means that you can write triggers which will initiate on specific events for example when user opens any document or saves any document What is Object Based Language?Object based language is language in which we can use objects & their properties i.e. we can use the Worksheet object and its property SheetName when some one clicks on a button
  • 6. Introduction to Visual Basic for Application - cont
 Visual Basic for ApplicationVisual Basic for Application is called VBA as it uses Visual Basic language and is capable of using application specific objects i.e. if we talk about VBA for Excel it can use Cell Object, Range Object, Worksheet Object, Workbook Object etc.
  • 7. Recording your first Macro Microsoft Excel 2007 provides you a very helpful option which enables you to record a macro and also modify and run afterwards Microsoft Excel 2007 don’t provide you the macro recording option by default for enabling macro recording at first you need to enable the Developer Tab, next slide defines step by step procedure to enable Developer Tab
  • 8. Enabling the Developer Tab Click on Office Button Click on Excel Options On Popular Tab checkShow Developer tab inRibbon
  • 9. Enabling the Developer Tab Once you are done with the process you will have the Developer Tab ready
  • 10. Recording your first Macro When you record macro Microsoft Excel 2007 provides you with 2 options either you can record a macro using Absolute References or Relative References If you go for Absolute References Excel’s behavior will be: You record a macro in Cell A1 type “Excel is Great” format Bold Cell B1 Whenever you play / run this macro Excel will always type “Excel is Great” in Cell A1 and format Bold Cell B1 no matter wherever your cursor is
  • 11. Recording your first Macro You can refer to following tab that you can click on Use Relative References which will enable you to record a macro in relative cells, as discussed whenever a relative reference macro is executed it will run in-place
  • 12. Recording your first Macro Click Developer Tab Click on Use Relative Reference Click on Record Macro 1 3 2
  • 13. Recording your first Macro As soon as you press record macro button the following screen will appear In the Macro name boxyou have to type the nameof macro In Shortcut key you can typeshort cut key which invokethe Macro Store macro (will discussedlater) You can also provide description of the macro
  • 14. Recording your first Macro As soon as you press OK in the previous dialog box two things happens first record macro button changesto Stop Recording Secondly Excel starts lookingfor your action and will recordthe same Please follow steps on the following slide to complete recording
  • 15. Recording your first Macro Click on Cell A1 type “Excel is Great” Select cells from A1:C1 click on Home Tab and click on Merge & Center Press Bold & Italics Now click on Developer Tab and click on Stop recording
  • 16. Playing your Macro You can execute the macro you just recorded by either clicking on the Macro button on the Developer Tab or by pressing Alt F8 , you can see the list of Recorded macros in the dialog box you can press Run buttonto execute the macro as soonas you press run you can seethat your recorded macro willexecute
  • 17. Behind the scenes To see what Excel did behind the scenes you can either click on Macros button on Developer Tab and select Edit or you can press Alt F11
  • 18. What it looks like This is what Excel did behind the scenes, it written the code for you. You can change the code if you want. You can either closethe window or pressAlt F11 again to goback to your Excelnormal screen
  • 19. Conclusion Macros are used to automate tasks or you can use macros to develop user interfaces Excel Macro use a language called VBA (Visual Basic for Applications), which is both Event Driven and Object Based The easiest way to look at macro is by using the Excel’s record Macro Feature You can even edit Excel’s recorded macro by yourself Soon we will publish a presentation which will guide you on how to write your own macro Please visit www.exceladvise.com For more on Excel Functions Please comment if you like it, or have any suggestions. 19 Photo Courtesy – www.freedigitalphotos.net