Suche senden
Hochladen
Using macros in microsoft excel part 1
âą
Als PPT, PDF herunterladen
âą
4 gefÀllt mir
âą
2,805 views
E
Er. Nawaraj Bhandari
Folgen
Using macros in microsoft excel part 1
Weniger lesen
Mehr lesen
Bildung
Diashow-Anzeige
Melden
Teilen
Diashow-Anzeige
Melden
Teilen
1 von 63
Jetzt herunterladen
Empfohlen
Microsoft Excel - Macros
Microsoft Excel - Macros
Eladio Jose Abquina
Â
Learn Excel Macro
Learn Excel Macro
AbhisheK Kumar Rajoria
Â
Getting started with Microsoft Excel Macros
Getting started with Microsoft Excel Macros
Nick Weisenberger
Â
VBA - Macro For Ms.Excel
VBA - Macro For Ms.Excel
C-Train Learning Point
Â
MACROS excel
MACROS excel
Zenobia Sukhia
Â
A Quick Simple MS Excel Macro
A Quick Simple MS Excel Macro
Pranav Ghode
Â
Vba introduction
Vba introduction
Sandesh DJSAS Singh
Â
An introduction to vba and macros
An introduction to vba and macros
Er. Nawaraj Bhandari
Â
Empfohlen
Microsoft Excel - Macros
Microsoft Excel - Macros
Eladio Jose Abquina
Â
Learn Excel Macro
Learn Excel Macro
AbhisheK Kumar Rajoria
Â
Getting started with Microsoft Excel Macros
Getting started with Microsoft Excel Macros
Nick Weisenberger
Â
VBA - Macro For Ms.Excel
VBA - Macro For Ms.Excel
C-Train Learning Point
Â
MACROS excel
MACROS excel
Zenobia Sukhia
Â
A Quick Simple MS Excel Macro
A Quick Simple MS Excel Macro
Pranav Ghode
Â
Vba introduction
Vba introduction
Sandesh DJSAS Singh
Â
An introduction to vba and macros
An introduction to vba and macros
Er. Nawaraj Bhandari
Â
Visual Basic 6.0
Visual Basic 6.0
Anjan Mahanta
Â
Teaching Excel
Teaching Excel
sam ran
Â
Advanced Microsoft Excel
Advanced Microsoft Excel
Eric Metelka
Â
Excel macro
Excel macro
kundanpgcil
Â
MS Excel Macros/ VBA Project report
MS Excel Macros/ VBA Project report
Prafull Dhamankar
Â
Excel Macro Magic
Excel Macro Magic
Elaine Giles
Â
E learning excel vba programming lesson 1
E learning excel vba programming lesson 1
Vijay Perepa
Â
MS Excel Basics
MS Excel Basics
Muhammad Yasir Bhutta
Â
Vba part 1
Vba part 1
Morteza Noshad
Â
MS Access teaching powerpoint tasks
MS Access teaching powerpoint tasks
skomadina
Â
Access lesson 03 Creating Queries
Access lesson 03 Creating Queries
Aram SE
Â
Full project
Full project
Rajat Thakral
Â
Microsoft Excel
Microsoft Excel
YasirKhan357
Â
Excel for beginner
Excel for beginner
Shashank Jain
Â
ms excel presentation...
ms excel presentation...
alok1994
Â
Scratch Lesson 1 â Basics
Scratch Lesson 1 â Basics
David Oromaner
Â
Ms access
Ms access
RoshanMaharjan13
Â
Lesson 1: Scratch Computer Programming
Lesson 1: Scratch Computer Programming
SeniorInfants
Â
Excel formulas tf-jul1605
Excel formulas tf-jul1605
Shaikh ŰŽÛŰź Kalim Ú©ÙÛÙ
Â
Introduction to Excel VBA/Macros
Introduction to Excel VBA/Macros
arttan2001
Â
Using macros in microsoft excel part 2
Using macros in microsoft excel part 2
Er. Nawaraj Bhandari
Â
VT University Live Session 3
VT University Live Session 3
VisibleThread
Â
Weitere Àhnliche Inhalte
Was ist angesagt?
Visual Basic 6.0
Visual Basic 6.0
Anjan Mahanta
Â
Teaching Excel
Teaching Excel
sam ran
Â
Advanced Microsoft Excel
Advanced Microsoft Excel
Eric Metelka
Â
Excel macro
Excel macro
kundanpgcil
Â
MS Excel Macros/ VBA Project report
MS Excel Macros/ VBA Project report
Prafull Dhamankar
Â
Excel Macro Magic
Excel Macro Magic
Elaine Giles
Â
E learning excel vba programming lesson 1
E learning excel vba programming lesson 1
Vijay Perepa
Â
MS Excel Basics
MS Excel Basics
Muhammad Yasir Bhutta
Â
Vba part 1
Vba part 1
Morteza Noshad
Â
MS Access teaching powerpoint tasks
MS Access teaching powerpoint tasks
skomadina
Â
Access lesson 03 Creating Queries
Access lesson 03 Creating Queries
Aram SE
Â
Full project
Full project
Rajat Thakral
Â
Microsoft Excel
Microsoft Excel
YasirKhan357
Â
Excel for beginner
Excel for beginner
Shashank Jain
Â
ms excel presentation...
ms excel presentation...
alok1994
Â
Scratch Lesson 1 â Basics
Scratch Lesson 1 â Basics
David Oromaner
Â
Ms access
Ms access
RoshanMaharjan13
Â
Lesson 1: Scratch Computer Programming
Lesson 1: Scratch Computer Programming
SeniorInfants
Â
Excel formulas tf-jul1605
Excel formulas tf-jul1605
Shaikh ŰŽÛŰź Kalim Ú©ÙÛÙ
Â
Introduction to Excel VBA/Macros
Introduction to Excel VBA/Macros
arttan2001
Â
Was ist angesagt?
(20)
Visual Basic 6.0
Visual Basic 6.0
Â
Teaching Excel
Teaching Excel
Â
Advanced Microsoft Excel
Advanced Microsoft Excel
Â
Excel macro
Excel macro
Â
MS Excel Macros/ VBA Project report
MS Excel Macros/ VBA Project report
Â
Excel Macro Magic
Excel Macro Magic
Â
E learning excel vba programming lesson 1
E learning excel vba programming lesson 1
Â
MS Excel Basics
MS Excel Basics
Â
Vba part 1
Vba part 1
Â
MS Access teaching powerpoint tasks
MS Access teaching powerpoint tasks
Â
Access lesson 03 Creating Queries
Access lesson 03 Creating Queries
Â
Full project
Full project
Â
Microsoft Excel
Microsoft Excel
Â
Excel for beginner
Excel for beginner
Â
ms excel presentation...
ms excel presentation...
Â
Scratch Lesson 1 â Basics
Scratch Lesson 1 â Basics
Â
Ms access
Ms access
Â
Lesson 1: Scratch Computer Programming
Lesson 1: Scratch Computer Programming
Â
Excel formulas tf-jul1605
Excel formulas tf-jul1605
Â
Introduction to Excel VBA/Macros
Introduction to Excel VBA/Macros
Â
Ăhnlich wie Using macros in microsoft excel part 1
Using macros in microsoft excel part 2
Using macros in microsoft excel part 2
Er. Nawaraj Bhandari
Â
VT University Live Session 3
VT University Live Session 3
VisibleThread
Â
ExcelMacros.pptx
ExcelMacros.pptx
AshishDhiman62
Â
Excel Vba Basic Tutorial 1
Excel Vba Basic Tutorial 1
rupeshkanu
Â
Autocad excel vba
Autocad excel vba
rjg_vijay
Â
Vbabook ed2
Vbabook ed2
NilsonVallecillo
Â
Excel 2007 Unit I
Excel 2007 Unit I
Raja Waseem Akhtar
Â
VBA Tips
VBA Tips
Ike Onwubuya
Â
50 MS Excel Tips and Tricks
50 MS Excel Tips and Tricks
BurCom Consulting Ltd.
Â
Getting Started with Excel Macros â Day #1
Getting Started with Excel Macros â Day #1
Tariq Al-Basha
Â
Working with Excel Macros
Working with Excel Macros
Jennifer Garbett
Â
Vba 2 (students copy)
Vba 2 (students copy)
Sherwin Keith Rivera
Â
VBA
VBA
Tekish
Â
0403-excel-macros-made-easy.pdf
0403-excel-macros-made-easy.pdf
ABHISHEK MALIK
Â
Excel300
Excel300
GermĂĄn Ariel Acosta
Â
ExcelMacros.pptx
ExcelMacros.pptx
PerlaVillarrealPlasc1
Â
Spreadsheet Analytical Tools
Spreadsheet Analytical Tools
Joselito Perez
Â
Pranavi verma-class-9-spreadsheet
Pranavi verma-class-9-spreadsheet
PranaviVerma
Â
Online Advance Excel & VBA Training in India
Online Advance Excel & VBA Training in India
ibinstitute0
Â
VBA
VBA
Rohit Garg
Â
Ăhnlich wie Using macros in microsoft excel part 1
(20)
Using macros in microsoft excel part 2
Using macros in microsoft excel part 2
Â
VT University Live Session 3
VT University Live Session 3
Â
ExcelMacros.pptx
ExcelMacros.pptx
Â
Excel Vba Basic Tutorial 1
Excel Vba Basic Tutorial 1
Â
Autocad excel vba
Autocad excel vba
Â
Vbabook ed2
Vbabook ed2
Â
Excel 2007 Unit I
Excel 2007 Unit I
Â
VBA Tips
VBA Tips
Â
50 MS Excel Tips and Tricks
50 MS Excel Tips and Tricks
Â
Getting Started with Excel Macros â Day #1
Getting Started with Excel Macros â Day #1
Â
Working with Excel Macros
Working with Excel Macros
Â
Vba 2 (students copy)
Vba 2 (students copy)
Â
VBA
VBA
Â
0403-excel-macros-made-easy.pdf
0403-excel-macros-made-easy.pdf
Â
Excel300
Excel300
Â
ExcelMacros.pptx
ExcelMacros.pptx
Â
Spreadsheet Analytical Tools
Spreadsheet Analytical Tools
Â
Pranavi verma-class-9-spreadsheet
Pranavi verma-class-9-spreadsheet
Â
Online Advance Excel & VBA Training in India
Online Advance Excel & VBA Training in India
Â
VBA
VBA
Â
Mehr von Er. Nawaraj Bhandari
Data mining approaches and methods
Data mining approaches and methods
Er. Nawaraj Bhandari
Â
Research trends in data warehousing and data mining
Research trends in data warehousing and data mining
Er. Nawaraj Bhandari
Â
Mining Association Rules in Large Database
Mining Association Rules in Large Database
Er. Nawaraj Bhandari
Â
Introduction to data mining and data warehousing
Introduction to data mining and data warehousing
Er. Nawaraj Bhandari
Â
Data warehouse testing
Data warehouse testing
Er. Nawaraj Bhandari
Â
Data warehouse physical design
Data warehouse physical design
Er. Nawaraj Bhandari
Â
Data warehouse logical design
Data warehouse logical design
Er. Nawaraj Bhandari
Â
Classification and prediction in data mining
Classification and prediction in data mining
Er. Nawaraj Bhandari
Â
Chapter 3: Simplification of Boolean Function
Chapter 3: Simplification of Boolean Function
Er. Nawaraj Bhandari
Â
Chapter 6: Sequential Logic
Chapter 6: Sequential Logic
Er. Nawaraj Bhandari
Â
Chapter 5: Cominational Logic with MSI and LSI
Chapter 5: Cominational Logic with MSI and LSI
Er. Nawaraj Bhandari
Â
Chapter 4: Combinational Logic
Chapter 4: Combinational Logic
Er. Nawaraj Bhandari
Â
Chapter 2: Boolean Algebra and Logic Gates
Chapter 2: Boolean Algebra and Logic Gates
Er. Nawaraj Bhandari
Â
Chapter 1: Binary System
Chapter 1: Binary System
Er. Nawaraj Bhandari
Â
Introduction to Electronic Commerce
Introduction to Electronic Commerce
Er. Nawaraj Bhandari
Â
Evaluating software development
Evaluating software development
Er. Nawaraj Bhandari
Â
Using macros in microsoft access
Using macros in microsoft access
Er. Nawaraj Bhandari
Â
Testing software development
Testing software development
Er. Nawaraj Bhandari
Â
Application software and business processes
Application software and business processes
Er. Nawaraj Bhandari
Â
An introduction to end user software development
An introduction to end user software development
Er. Nawaraj Bhandari
Â
Mehr von Er. Nawaraj Bhandari
(20)
Data mining approaches and methods
Data mining approaches and methods
Â
Research trends in data warehousing and data mining
Research trends in data warehousing and data mining
Â
Mining Association Rules in Large Database
Mining Association Rules in Large Database
Â
Introduction to data mining and data warehousing
Introduction to data mining and data warehousing
Â
Data warehouse testing
Data warehouse testing
Â
Data warehouse physical design
Data warehouse physical design
Â
Data warehouse logical design
Data warehouse logical design
Â
Classification and prediction in data mining
Classification and prediction in data mining
Â
Chapter 3: Simplification of Boolean Function
Chapter 3: Simplification of Boolean Function
Â
Chapter 6: Sequential Logic
Chapter 6: Sequential Logic
Â
Chapter 5: Cominational Logic with MSI and LSI
Chapter 5: Cominational Logic with MSI and LSI
Â
Chapter 4: Combinational Logic
Chapter 4: Combinational Logic
Â
Chapter 2: Boolean Algebra and Logic Gates
Chapter 2: Boolean Algebra and Logic Gates
Â
Chapter 1: Binary System
Chapter 1: Binary System
Â
Introduction to Electronic Commerce
Introduction to Electronic Commerce
Â
Evaluating software development
Evaluating software development
Â
Using macros in microsoft access
Using macros in microsoft access
Â
Testing software development
Testing software development
Â
Application software and business processes
Application software and business processes
Â
An introduction to end user software development
An introduction to end user software development
Â
KĂŒrzlich hochgeladen
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
pradhanghanshyam7136
Â
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Denish Jangid
Â
Single or Multiple melodic lines structure
Single or Multiple melodic lines structure
dhanjurrannsibayan2
Â
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
Mebane Rash
Â
Application orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
RamjanShidvankar
Â
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
camerronhm
Â
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
TechSoup
Â
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
Pooky Knightsmith
Â
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
Â
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
Â
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
bronxfugly43
Â
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Celine George
Â
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
Admir Softic
Â
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
Esquimalt MFRC
Â
Understanding Accommodations and Modifications
Understanding Accommodations and Modifications
MJDuyan
Â
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
Elizabeth Walsh
Â
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
christianmathematics
Â
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
Association for Project Management
Â
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
Dr. Sarita Anand
Â
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
MaryamAhmad92
Â
KĂŒrzlich hochgeladen
(20)
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Â
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Â
Single or Multiple melodic lines structure
Single or Multiple melodic lines structure
Â
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
Â
Application orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
Â
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
Â
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
Â
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
Â
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
Â
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
Â
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
Â
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Â
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
Â
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
Â
Understanding Accommodations and Modifications
Understanding Accommodations and Modifications
Â
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
Â
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
Â
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
Â
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
Â
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
Â
Using macros in microsoft excel part 1
1.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.1 © NCC Education LimitedV1.0 Uses of Macros in Microsoft Excel âą Macros can be used in Excel to automate tasks, such as: â Data entry and validation â Data selection â Interactive user forms â Formatting features and functions â Data output â Navigation
2.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.2 © NCC Education LimitedV1.0 Creating a Macro âą Plan your macro - you should plan the steps that you want a macro to perform before you record or write it (remember the importance of planning was discussed in Topic 2, Slide 18). âą A macro that is used often can be assigned to shortcut keys, buttons, pictures or icons, without having to open the Macro dialogue box. âą A macro can be created by either recording it using the Macro recorder or writing VBA code in the VB Editor. Each development method will be used in this Topic and in Topic 9.
3.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.3 © NCC Education LimitedV1.0 Overview of Recording a Macro âą The macro recorder is turned on. âą A name for the macro is entered, it is assigned to a short cut key (optional), it is saved and a description is given to it (optional). âą The recorder is started. âą Steps for the macro are entered. âą The recorder is stopped.
4.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.4 © NCC Education LimitedV1.0 Turning on the Macro Recorder 1. Select the Macro option. 2. The Record Macro dialogue box is displayed and here you can: - name your macro - assign your macro to short cut keys - save your macro - describe your macro
5.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.5 © NCC Education LimitedV1.0 Naming a Macro âą The name must begin with a letter. âą It must not contain spaces. âą The underscore must be used to separate words.
6.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.6 © NCC Education LimitedV1.0 Saving a Macro âą When a macro is created, it can be saved in one of the following places: - This Workbook (the macro will only be available in the spreadsheet in which it was created. - Personal Macro Book (the macro will be available to all spreadsheets) - New Workbook (the macro will only be available in that Spreadsheet which is newer than previous)
7.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.7 © NCC Education LimitedV1.0 Starting to Record a Macro 1. Once you have began to record your macro, perform each action that you want to include in the macro. 2. Note that the mouse can be used to click on commands and option, but the macro recorder cannot record mouse actions. To move the insertion point or select, copy, or move text, you must use keyboard commands. 3. To stop recording your macro at any click on the stop macro button on the bottom left corner of the screen.
8.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.8 © NCC Education LimitedV1.0 Running a Macro âą If the macro has been assigned to a key combination, that key combination can be pressed to run the macro. âą Or, select the macro from the macro list and then select Run.
9.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.9 © NCC Education LimitedV1.0 Formatting Titles and Formulas - 1 âą How to prepare a spreadsheet each month with the same titles, formatting and formulas: â When you want to create a new spreadsheet, you usually open the previous monthâs spreadsheet, delete the figures and save it as the current monthâs spreadsheet. â If you create a template spreadsheet that contains a macro that automates the titles, formatting and formulas, you can open a new spreadsheet, run the macro and then all you will have to do is enter the current monthâs figures.
10.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.10 © NCC Education LimitedV1.0 Formatting Titles and Formulas - 2 1. Open a new spreadsheet. 2. Open the macro dialogue box. 3. Enter MonthlyFinancialReport for the name of the macro. 4. Save it in the Personal Macro Workbook. 5. Enter a description. 6. Click OK.
11.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.11 © NCC Education LimitedV1.0 Formatting Titles and Formulas - 3 6. The following data is entered into the spreadsheet: Each heading is in bold. 7. In cell B5, the formula =SUM(A3-A4) is entered. 8. The contents of cell B5 are copied to cells C5 and D5.
12.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.12 © NCC Education LimitedV1.0 Formatting Titles and Formulas - 4 9. In cell F3 the formula =SUM(B3:E3) is entered. 10. In cell F4 the formula =SUM(B4:E4) is entered. 11. In cell F5 the formula =SUM(B5:E5) is entered. 12. The macro recorder is turned off. 13. Data is then entered into the worksheet to test that the formulas work. 14. The macro is tested by opening a new spreadsheet (or worksheet) and running the macro to display the template.
13.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.13 © NCC Education LimitedV1.0 Format a Table âą How to format a table (formatting color, font and border styles): 1. Open a spreadsheet that either contains a table or create one. 2. Open the macro dialogue box and enter the required data. 3. Click OK. 4. Format the table. 5. Stop the recording the macro. 6. Test the macro.
14.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.14 © NCC Education LimitedV1.0 Dates and Times - 1 1. Click in the cell in which you want the date to appear. 2. Open the Record Macro dialogue box. 3. Enter the macro name, etc., Click OK 4. In the cell enter =TODAY() 5. Right click and choose format cells. 6. Select Month date year as the format, click OK. 7. Stop recording.
15.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.15 © NCC Education LimitedV1.0 Dates and Times - 2 âą If you do not want the current date to be displayed on the spreadsheets, but want it to remain static: 1. Create the macro up until the step, âSelect Month date year as the format, click OKâ. 2. Select Copy > Paste > Paste Values (the value in the Formula bar changes from TODAY() to the actual date) 3. Press ESC. 4. Stop recording. 5. Test the macro.
16.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.16 © NCC Education LimitedV1.0 Data Entry - 1 âą In Topic 6 you wrote macros in the VB Editor that displayed simple message boxes conveying information to a user, allowing them to click on OK but not enabling interaction. We will now create simple interactive macros. âą The following is a macro that displays an input box which requests a user to enter their name; when a user enters their name, it is displayed on the spreadsheet. âą VBA will be used to write the macro in the VB Editor.
17.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.17 © NCC Education LimitedV1.0 Data Entry - 2 Sub EnterName() Dim strName As String strName = InputBox("Please enter your name", "Enter Name") Range("A1").Select ActiveCell.FormulaR1C1 = strName End Sub
18.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.18 © NCC Education LimitedV1.0 Message Boxes and Feedback âą The message box below provides feedback to a user depending on which button is selected. âą The macro has been written so that if YES is selected, another message box is then displayed.
19.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.19 © NCC Education LimitedV1.0 Message Box Code âą The code for the previous message box is as follows: Sub Message() x = MsgBox("Do you want to continue?", 3) If x = 7 Then Exit Sub MsgBox ("OK, we'll continue using this macro") End Sub
20.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.20 © NCC Education LimitedV1.0 Explanation of Message Box Code âą These two lines of code need explaining: x = MsgBox("Do you want to continue?", 3) If x = 7 Then Exit Sub âą The 3 refers to a display of optional buttons that can be displayed in a message box. There are five combinations of buttons that can be displayed, as can be seen on the next slide:
21.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.21 © NCC Education LimitedV1.0 Message Box Buttons Name Value Description vbOKCancel 1 Displays OK and Cancel buttons vbAbortRetryIgnore 2 Displays Abort, Retry and Ignore buttons vbYesNoCancel 3 Displays Yes, No and Cancel buttons vbYesNo 4 Displays Yes and No buttons vbRetryCancel 5 Displays Retry and Cancel buttons
22.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.22 © NCC Education LimitedV1.0 Further Explanation âą The following line of code needs to be explained: If x = 7 Then Exit Sub âą When the user clicks on a button, an action occurs depending on what value has been assigned to the button âą x contains the value 7, which means that when the No button is clicked, the message box will no longer be displayed â this value can be seen in with other values on the following slide:
23.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.23 © NCC Education LimitedV1.0 Values Assigned to Buttons Name Value Description vbOK 1 Ok VbCancel 2 Cancel vbAbort 3 Abort vbRetry 4 Retry vbIgnore 5 Ignore vbYes 6 Yes vbNo 7 No
24.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.24 © NCC Education LimitedV1.0 Macro on Excel Create a Macro: With Excel VBA you can automate tasks in Excel by writing so called macros. MsgBox: The MsgBox is a dialog box in Excel VBA you can use to inform the users of your program. Range Object: The Range object, which is the representation of a cell (or cells) on your worksheet, is the most important object of Excel VBA.
25.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.25 © NCC Education LimitedV1.0 Variables:How to declare, initialize and display a variable in Excel VBA. If Then Statement: Use the If Then statement in Excel VBA to execute code lines if a specific condition is met. Loop: Looping is one of the most powerful programming techniques. A loop in Excel VBA enables you to loop through a range of cells with just a few codes lines.
26.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.26 © NCC Education LimitedV1.0 String Manipulation: In this chapter you find the most important functions to manipulate strings in Excel VBA Date and Time: Learn how to work with dates and times in Excel VBA. Events: Events are actions performed by users which trigger Excel VBA to execute code.
27.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.27 © NCC Education LimitedV1.0 Array: An array is a group of variables. In Excel VBA, you can refer to a specific variable (element) of an array by using the array name and the index number. Function and Sub: In Excel VBA, a function can return a value while a sub cannot. Userform: This chapter teaches you how to create an Excel VBA Userform
28.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.28 © NCC Education LimitedV1.0 Range The Range object, which is the representation of a cell (or cells) on your worksheet, is the most important object of Excel VBA Range("B3").Value = 2 Range(Cells(1, 1), Cells(4, 1)) = 5 Dim example As Range Set example = Range("A1:C4") example.Value = 8
29.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.29 © NCC Education LimitedV1.0 RANGE Dim example As Range Set example = Range("A1:C4") example.Value = 8 Dim example As Range Set example = Range("A1:C4") example.Select
30.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.30 © NCC Education LimitedV1.0 SELECT Dim example As Range Set example = Range("A1:C4") example.Columns(2).Select
31.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.31 © NCC Education LimitedV1.0 COPY AND PASTE Range("A1:A2").Select Selection.Copy Range("C3").Select ActiveSheet.Paste Dim example As Range Set example = Range("A1:C4") example.Select
32.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.32 © NCC Education LimitedV1.0 CLEAR Range("A1").ClearContents Range("A1").Value = ""
33.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.33 © NCC Education LimitedV1.0 COUNT Dim example As Range Set example = Range("A1:C4") MsgBox example.Count MsgBox example.Rows.Count Then??
34.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.34 © NCC Education LimitedV1.0 VARIABLES Variable Declaration Dim x As Integer Dim book As String Dim x As Double
35.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.35 © NCC Education LimitedV1.0 VARIABLES Dim continue As Boolean continue = True If continue = True Then MsgBox "Boolean variables are coolâ
36.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.36 © NCC Education LimitedV1.0 If Then Statement Dim score As Integer, result As String score = Range("A1").Value If score >= 60 Then result = "pass" Range("B1").Value = result
37.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.37 © NCC Education LimitedV1.0 For Loop Dim i As Integer For i = 1 To 6 Cells(i, 1).Value = 100 Next I
38.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.38 © NCC Education LimitedV1.0 For Loop Dim i As Integer, j As Integer For i = 1 To 6 For j = 1 To 2 Cells(i, j).Value = 100 Next j Next i
39.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.39 © NCC Education LimitedV1.0 While Loop Dim i As Integer i = 1 While i < 3 Cells(i, 2).Value = 20 i = i + 1 Wend
40.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.40 © NCC Education LimitedV1.0 Do While Loop Dim i As Integer i = 1 Do While i < 6 Cells(i, 1).Value = 20 i = i + 1 Loop
41.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.41 © NCC Education LimitedV1.0 String Manipulation Join Strings Dim text1 As String, text2 As String text1 = "Hi" text2 = "Tim" MsgBox text1 & " " & text2
42.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.42 © NCC Education LimitedV1.0 Dim text As String text = "example text" MsgBox Left(text, 4) MsgBox Right(text, 4) MsgBox Len("example text") MsgBox Instr("example text", "am")
43.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.43 © NCC Education LimitedV1.0 Date and Time Dim exampleDate As Date exampleDate = DateValue("Jun 19, 2010") MsgBox Year(exampleDate) Dim firstDate As Date, secondDate As Date firstDate = DateValue("Jun 19, 2010") secondDate = DateAdd("d", 3, firstDate) MsgBox secondDate
44.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.44 © NCC Education LimitedV1.0 Date and Time
45.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.45 © NCC Education LimitedV1.0 Workbook Open Event
46.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.46 © NCC Education LimitedV1.0 One-dimensional Array Dim Films(1 To 5) As String Films(1) = "Lord of the Rings" Films(2) = "Speed" Films(3) = "Star Wars" Films(4) = "The Godfather" Films(5) = "Pulp Fiction" MsgBox Films(4)
47.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.47 © NCC Education LimitedV1.0 Two-dimensional Array Dim Films(1 To 5, 1 To 2) As String Dim i As Integer, j As Integer For i = 1 To 5 For j = 1 To 2 Films(i, j) = Cells(i, j).Value Next j Next i MsgBox Films(4, 2)
48.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.48 © NCC Education LimitedV1.0 Two-dimensional Array
49.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.49 © NCC Education LimitedV1.0 Function and Sub Procedure The difference between a function and a sub in Excel VBA is that a function can return a value while a sub cannot. Functions and subs become very useful as program size increases.
50.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.50 © NCC Education LimitedV1.0 Function Function Area(x As Double, y As Double) As Double Area = x * y End Function Dim z As Double z = Area(3, 5) + 2 MsgBox z
51.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.51 © NCC Education LimitedV1.0 Sub Procedure Sub Area(x As Double, y As Double) MsgBox x * y End Sub Area 3, 5
52.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.52 © NCC Education LimitedV1.0 User form ïForm Controls are objects which you can place onto an Excel Worksheet or User Forms, which give you the functionality to interact with your data. ïFor example, drop-down boxes, list boxes, spinners, and scroll bars are useful for selecting items from a list ïOption Buttons and Check Boxes allow selection of various options. Buttons allow execution of VBA code.
53.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.53 © NCC Education LimitedV1.0 User form
54.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.54 © NCC Education LimitedV1.0 User form ïBy adding form controls to user forms, we can tell Excel how the value entered in that should be treated. This is done a special type of macros called as Events. ïBy adding a control to a worksheet and linking it to a cell, you can return a numeric value for the current position of the control. You can use that numeric value in conjunction with the Offset, Index or other worksheet functions to return values from lists.
55.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.55 © NCC Education LimitedV1.0 Current Position Dim emptyRow As Long 'Make Sheet1 active Sheet1.Activate 'Determine emptyRow emptyRow = WorksheetFunction.CountA(Range("A:A")) + 1
56.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.56 © NCC Education LimitedV1.0 Inserting on Current Position Sub insert_Date() Cells(emptyRow,1).value=tebox1.value Cells(emptyRow,2).value=tebox2.value Cells(emptyRow,3).value=combo1.value Cells(emptyRow,4).value=listbox1.value End sub
57.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.57 © NCC Education LimitedV1.0 Current Position
58.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.58 © NCC Education LimitedV1.0 Add the Controls To add the controls to the Userform, execute the following steps. 1. Open the Visual Basic Editor. 2. Click Insert, Userform. If the Toolbox does not appear automatically, click View, Toolbox. Your screen should be set up as below.
59.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.59 © NCC Education LimitedV1.0 Add the Controls
60.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.60 © NCC Education LimitedV1.0 Show the Userform Private Sub CommandButton1_Click() DinnerPlannerUserForm.Show End Sub
61.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.61 © NCC Education LimitedV1.0 References - 1 âą Gonzalez, J., Meister, C., Ozgur, S., Dilworth, B., Troy, A. and Brandt, T. (2006). Office VBA Macros You Can Use Today: Over 100 Amazing Ways to Automate Word, Excel, PowerPoint, Outlook & Access, Holy Macroi Press. âą Microsoft Office: Macros and Security. (2011). http://www.msoffice-tutorial.com/macro-security.php
62.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.62 © NCC Education LimitedV1.0 References - 2 âą Visual Basic/Getting Started. (2010). [Available Online] http://en.wikibooks.org/wiki/Visual_Basic/Getting_Started âą VBScript Glossary. (1997). [Available Online] http://tinyurl.com/69kxbe5
63.
Using Macros in
Microsoft Excel â Part 1 Topic 8 - 8.63 © NCC Education LimitedV1.0 Topic 8 â Using Macros in Microsoft Excel Part 1 Any Questions?
Hinweis der Redaktion
NCC Education - End Slide Master
Jetzt herunterladen