Hi Nisha,
"...
Macro on Excel - please help
HI AL,
Can anyone explain to me in detail about macros in Excel..."
Please follow the steps below to get all your queries answered:
1. As mentioned by Amit, a macro is used to automate repetitive tasks.
For example, if you have a list of 3 students - A, B, and C - with scores in Subjects 1, 2, 3, 4. If you want to calculate the total score of each student, you would need to write a formula for the sum in every column. Instead, if you create a macro for the same, you won't need to do it every time. Once you define the macro, it will calculate the total for whichever student you choose.
2. How to create a macro in Excel?
Answer - Using the same example, I have attached an Excel sheet with this post. Please refer to it.
- Create a table of contents (in this case, Student vs. Scores).
- Go to Tools > Macro > Security (Select Medium).
- Go to Tools > Macro > Record New Macro > Give Macro Name (e.g., Addition) > Select Store in this workbook > Give a shortcut key if you want to (not necessary) > Click OK.
- Go to cell D8 - write "=SUM(D4:D7)" - Click Enter - Click Stop recording Macro.
- The macro is now stored.
By running the macro, it will add values from E4 to E7 when your cursor is in E8 (Blue cell).
- Go to Tools > Macro > Run macro keeping the cursor in F8 - It will total the marks scored by student C (Orange cell).
- To simplify the process of running the macro, you can use a shortcut key (if assigned).
- Also, you can draw a rectangle or any other drawing object, right-click on it and choose "Assign macro" - click on the macro name. So, whenever you click on this rectangle, the macro will run.
3. This is a simple example of a macro. You can create graphs, charts, assessment sheets with thousands of entries, etc. It can save more than 90% of the time you may spend on writing/copying formulas everywhere.
4. Any non-IT person can create this. For using MS Office (Word, PowerPoint, Excel, etc.), no specialist is required. So, please remove any fear you have.
All the best.