IT tutorials
 
Office
 

Microsoft Excel 2010 : Automating Repetitive Tasks by Using Macros - Creating and Modifying Macros

- Windows 10 Product Activation Keys Free 2019
- How to active Windows 8 without product key
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
4/12/2014 9:08:54 PM

The first step of creating a macro is to plan the process you want to automate. Computers today are quite fast, so adding an extra step that doesn’t affect the outcome of a process doesn’t slow you down noticeably, but leaving out a step means you will need to re-record your macro. After you plan your process, you can create a macro by clicking the View tab and then, in the Macros group, clicking the Macros arrow. In the list that appears, click Record Macro. When you do, the Record Macro dialog box opens.

Creating and Modifying Macros

After you type the name of your macro in the Macro Name box, click OK. You can now perform the actions you want Excel to repeat later; when you’re done, in the Macros list, click Stop Recording to add your macro to the list of macros available in your workbook.

To modify an existing macro, you can simply delete the macro and re-record it. Or if you just need to make a quick change, you can open it in the Visual Basic Editor and add to or change the macro’s instructions. To delete a macro, open the Macro dialog box, click the macro you want to delete, and then click Delete.

See Also

For more information about using the Visual Basic Editor, press Alt+F11 to display the Visual Basic Editor, and then press F1 to display the Visual Basic Help dialog box.

In this exercise, you’ll record, edit, save, and run a macro that removes the bold formatting from selected cells.

Open the YearlySalesSummary_start workbook, click the Enable Content button on the Message Bar (if necessary), and save the workbook as YearlySalesSummary. Then follow the steps.
  1. On the View tab, in the Macros group, click the Macros arrow and then, in the list that appears, click Record Macro.

    Set Up

    The Record Macro dialog box opens.

  2. In the Macro name box, delete the existing name, and then type RemoveHighlight.

  3. Click OK.

    The Record Macro dialog box closes.

  4. Select the cell range C4:C7.

    The text in these cells is currently bold.

  5. On the Home tab, in the Font group, click the Bold button.

    Set Up
  6. On the View tab, in the Macros list, click Stop Recording.

    Excel stops recording the macro.

  7. In the Macros list, click View Macros.

    The Macro dialog box opens.

  8. In the Macro name area, click RemoveHighlight, and then click Edit.

    The Visual Basic Editor starts.

    Set Up
  9. Edit the line of code that currently reads Range(“C4:C7”). Select so that it reads Range(“C3:C9”). Select.

    This macro statement selects the cell range C3:C9, not the incorrect range C4:C7.

  10. On the Standard toolbar of the Visual Basic Editor, click the Save button to save your change.

    Set Up
  11. On the title bar of the Visual Basic Editor window, click the Close button.

    Set Up

    The Visual Basic Editor closes.

  12. Select cells C3:C9, format them as bold, and then click cell C9.

    Excel formats the cells’ contents in bold.

  13. In the Macros list, click View Macros.

    The Macro dialog box opens.

  14. Click RemoveHighlight, and then click Run.

    The bold formatting is removed from cells C3:C9.

  15. On the Quick Access Toolbar, click the Save button.

    Excel saves your workbook.

Clean Up

Close the YearlySalesSummary workbook.

 
Others
 
- Microsoft Excel 2010 : Enabling and Examining Macros (part 2) - Examining Macros
- Microsoft Excel 2010 : Enabling and Examining Macros (part 1) - Macro Security in Excel 2010
- Microsoft Project 2010 : Maintaining Baselines (part 3) - Resetting a Baseline , Multiple Baselines
- Microsoft Project 2010 : Maintaining Baselines (part 2) - Rolling-Wave Planning with Baselines
- Microsoft Project 2010 : Maintaining Baselines (part 1) - Clearing a Baseline
- Microsoft Project 2010 : Viewing Baselines (part 2) - Formatting the Gantt Chart to Display the Baseline
- Microsoft Project 2010 : Viewing Baselines (part 1) - Tracking Gantt View and the Variance Table
- Microsoft Project 2010 : Understanding and Setting Baselines
- Microsoft Project 2010 : Strategic Importance of Project 2010
- Microsoft PowerPoint 2010 : Animating a SmartArt Graphic (part 2) - Apply a Customized Animation to a SmartArt Graphic, Reverse the Order of a SmartArt Graphic Animation
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
programming4us programming4us
 
Popular tags
 
Video Tutorail Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Biztalk Exchange Server Microsoft LynC Server Microsoft Dynamic Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 Adobe Indesign Adobe Flash Professional Dreamweaver Adobe Illustrator Adobe After Effects Adobe Photoshop Adobe Fireworks Adobe Flash Catalyst Corel Painter X CorelDRAW X5 CorelDraw 10 QuarkXPress 8 windows Phone 7 windows Phone 8 BlackBerry Android Ipad Iphone iOS