Saturday, March 20, 2010

How to Create a Code to Generate Word Documents

If you find yourself creating budget sheets over and over again in Microsoft Word, the task might before tiresome. Instead of repetitively typing in the same credits, debits and formulas, you can get Excel to format your budget sheet for you using the macro function of Visual Basic for Applications (VBA). The macro function allows you to create complex, pre-formatted documents--and you don't need to know a single line of VBA code.

Instructions

Things You'll Need:

  • Excel 2007
  1. Step1

    Click on "View," then click on "Macros->Start Recording."

  2. Step 2

    Type a name for your macro into the box. For example, if you are creating a budget sheet, you might want to type "Budget."

  3. Step 3

    Type in an easily remembered letter into the key combination box. For example, you may want to choose "B" for "Budget" to get the shortcut keys "Ctrl" and "B."

  4. Step 4

    Press "OK" to start macro recording.

  5. Step 5

    Click the "Office" button.

  6. Step 6

    Click on "Blank Workbook."

  7. Step 7

    Type the information into your form as usual. For example, if you want to generate a budget form, you might have columns for "Income" and "Expenses."

  8. Step 8

    Click on "Macro->Stop recording" twhen you have finished your workbook. Your macro is now ready to use. Just click on the key combination from Step 3 (in this example, "Ctrl" and "B") to generate your new workbook in an instant

No comments:

Post a Comment