Page 750 - Excel 2013 All-in-One For Dummies
P. 750

732 Using the Visual Basic Editor
 7. Select “Mind Over Media” on line 12 and replace it with SpreadsheetTitle (with no quotation marks).
8. Save the edited macro by clicking the Save button on the Visual Basic toolbar and then return to the worksheet by clicking the View Microsoft Excel button or pressing Alt+F11. Then, click the Hide button in the Window group of the VIEW tab.
Now, you’re ready to open a new workbook and run the edited macro by pressing Ctrl+N.
Figure 2-4 shows the Code window with the edited Company_Name macro after adding the statements that make it interactive. Figure 2-5 shows the Spreadsheet Title dialog box in action in the worksheet. This input dialog box now automatically appears and prompts you for input whenever you run the edited and now fully interactive version of the Company_Name macro.
To go ahead and enter Mind Over Media into the current cell and then format it by using the rest of the macro commands, you just click OK in this custom dialog box. To enter and format the name of another company, you simply type the name of the company (which automatically replaces Mind Over Media in the text box) before you click OK.
  Figure 2-4:
The Company_ Name Code window after adding variables and the InputBox function.
 


























































































   748   749   750   751   752