- Enter a number in the active cell. Make sure this cell is selected before you record the macro.
- Go to the menu, click on Tools –> Macro –> Record New Macro.
- Enter a name for the macro e.g. Custom_Num_Format (note: spaces are not allowed), select to store the macro in “Personal Macro Workbook”.
- Go to the menu bar and select Format -> Cells.
- In the Format Cell window, select the Number Tab.
- Select the number category, check the box “Use 1000 Separator (,)”, select the negative number format with bracket. In this step, you can choose your own number formatting.
- Go to the Patterns Tab and select the color RED to colour the selected cell. You can choose to skip this step if you do not want format the cell RED.
- Click OK to exit Format Cell Dialog box.
- Stop the Macro Recorder by click on the pop up box. Alternatively, goto to menu, click on Tools –> Macro –> Stop Recording.
- Close the Excel Application. You can click on the big RED X on the top right hand corner. There will be a number of prompts depending on how many worksheets are opened. Look out for the prompt on whether you want to save the changes made to the personal macro workbook. Click Yes. This will save the macro and make it available for use every time you open Excel.
Once macro recording starts, try not to touch the worksheet. If you accidentally select a cell in the porcess, the action will be captured and the macro will always include this action of selecting the cell.


No comments:
Post a Comment