programming4us
 
Office
 

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

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
 
 
REVIEW
 
- First look: Apple Watch

- 10 Amazing Tools You Should Be Using with Dropbox

- Sigma 24mm f/1.4 DG HSM Art

- Canon EF11-24mm f/4L USM

- Creative Sound Blaster Roar 2

- Alienware 17 - Dell's Alienware laptops

- Smartwatch : Wellograph

- Xiaomi Redmi 2
 
VIDEO TUTORIAL
 
- How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 1)

- How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 2)

- How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 3)
 
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
 
Top 10
 
- Setup Free Media Server To Stream Videos To DLNA Compatible TV, Xbox 360 & PS3 (Play Station 3)
- How To Install Android Market & Google Apps On Kindle Fire
- How To Make Ubuntu Look Like Windows 7
- How To Add A New Account in MS Outlook 2013
- Get Android & Mac OS X Style Gadgets For Windows 7 & Windows 8 With XWidget
- How To Activate Microsoft Office 2013
- How To Install Actual Facebook App On Kindle Fire
- How To Create, View And Edit Microsoft Office Files On Kindle Fire
- Download Attractive Business PowerPoint Templates For Free At SlideHunter
- How To Use And Enable Hibernate & Sleep Mode In Windows 8