Record macro in Excel

Record Macro option in Excel helps you to record all the operations that you are performing in the excel sheet when the record macro is enabled. This option facilitates users who do not know Visual Basic to write a macro.

Lets have a scenario for formatting a table using Record Macro option.

1. Create a sample data in a worksheet

Sample data to record macro

Sample data to record macro

2. Select entire sample data using Ctrl+End + Right Arrow Key and Ctrl + End + Down Arrow Key to select entire table. This helps to format entire table, if your table contains n number of rows and n number of columns. Click Record Macro in Developer’s Tab. Enter macro name, shortcut key and description if required.

Click Record Macro in Developer's tab

Click Record Macro in Developer’s tab

3. Format the table as you wish.

Format the table

Format the table

4. After completing the table format, stop macro recording. Click Stop Recording in Developer’s tab

Click stop recording

Click stop recording

5. Now, try to load with some sample data (for example, have data with n number of rows and n number of columns) in the same sheet or separate sheet but in the same workbook.

Load the sheet with sample data

Load the sheet with sample data

6. Select entire data in the sheet and run the macro. To run the macro, press Alt + F8 shortcut key to get macro dialog box

Press Alt + F8 to run macro

Press Alt + F8 to run macro

7. Find that entire table have formatted as we have formatted the sample data.

Data is formatted automatically

Data is formatted automatically

Share This Post

Related Articles

Leave a Reply

© 2017 Techy Diary. All rights reserved.
Powered by Charvi Groups