Recording a Simple Macro

Written by Amey Dabholkar

July 31, 2015

Introduction

You must have heard the term “Macro” in some or the other places. If you are using Photoshop or i would say that you are master of Photoshop then you must be aware regarding the term Macros. Macros basically means automation of the activities. If you are constantly reading my blog post some i have also added an article regarding an automation done with VBA Code. It relates with the macro recording. Basically what a macro recorder does is that it records all steps and presents in the code form in the VBA Editor.

The Activities like Selection of cells, Changing the color, font etc is done via macro recording. Some also automates the Pivot Table , Dashboard creating process via macros. Macro Creating process is the first step of learning Visual Basics for Applications. Please do not confuse your self with Visual basic coding programming which you do in visual studios. It is a kind of similar process to visual basic programming in visual studios.

Download the Sample file associated with this blog post

Recording a Simple Macro of coloring a cell.

Familiarize yourself with important terminologies

But instead you can use “Letters”, “Numbers” Underscore “_”. So if you want to add spaces in your macro instead use underscore. If you have not written correctly or written number first then the macro will show an error message.

2. Shortcut Key: Shortcut Key is the keystroke use to execute the macro. For example a key stroke to execute a macro is “CTRL + SHIFT + N”. Then after pressing that keystroke the macro will execute. Note the important point if you assign a predefined Shortcut key then that shortcut key will temporary will be unavailable. It will be available only when you delete macro or modify the shortcut key. For example if you set key stroke to “CTRL + C” then the original command i.e copy will be unavailable but instead it will execute your macro. It is recommended don’t use the keystroke which are inbuilt In excel.

3. Store Macro in: Excel provides 3 different location to store macro.

1. This Workbook: This is the default option to be selected when you open the macro recorder dialogue box. It stores the macro in a new module inside this workbook. A module is a set of macro codes. This is most advisable setting necessary to store your macro. Use this settings if you need to store your macro in this workbook only. This macro will not be available in other workbook which you open for making it available in other workbook it is necessary to select 2nd option I.e Personal Macro Workbook

2. Personal Macro Workbook: A personal macro workbook is a add-in macro project which is available when you select to save in the personal macro workbook. This selection makes the macro store in a new hidden workbook known as Personal Macro Workbook. Macro stored in this workbook is available in all the other workbook. It is advisable that store only those macro which are necessary for all the workbook which you open.

3. New Workbook: This option creates a new workbook and saves the macro inside that workbook. This option is good if you want to test a macro to run and you are not confident about your macro. This option is not advisable.

4. Description: This option enables you to write the description to your macro. If you want to explain what this recorded code of macro does. You can also write the name of developer of macro also recording date of the same.

Run your Macro through button

The first important thing which you need to do is Enable the developer tab. I have explained in depth in other blog post. Link is down below

Thanks ,

Please Share

0 Comments

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Pin It on Pinterest

Share This