Exercise: Enter Dating Agency Details into Input Boxes

This exercise is provided to allow potential course delegates to choose the correct Wise Owl Microsoft training course, and may not be reproduced in whole or in part in any format without the prior written consent of Wise Owl.

The answer to the exercise will be included and explained if you attend the course listed below!

Category ==> Excel VBA Macros  (49 exercises)
Topic ==> Messages and variables  (4 exercises)
Level ==> Average difficulty
Course ==> Excel VBA macros
Before you can do this exercise, you'll need to download and unzip this file (if you have any problems doing this, click here for help).

You need a minimum screen resolution of about 700 pixels width to see our exercises. This is because they contain diagrams and tables which would not be viewable easily on a mobile phone or small laptop. Please use a larger tablet, notebook or desktop computer, or change your screen resolution settings.

Open the WODA Application.xlsm file.  Your task is to create subroutines which can be attached to the two buttons on the application form.

Application form

The text on the buttons should provide a clue as to what they should do.


Create a subroutine which you can attach to the Add Details button.  A basic outline for this procedure could be:

  • Declare variables to hold each value the user will enter.
  • Use input boxes to ask the user to enter each value and capture the result in the variables you have declared.
  • Write the value of each variable into the appropriate cell on the worksheet.
  • Present a message which informs the user that the application is complete.

For reference, the code to capture the value of an input box is:

MyVariable = InputBox("Type something")

Right-click on the Add Details button and choose to assign the procedure you have written.

Click the button to check that the system works.

Input boxes

Type a value into each input box and click OK to see the next one.

At the end of the procedure, all of the cells should be filled in.

Final message

You can display a message to tell the user that the application is complete.

Now create a subroutine which you can attach to the Edit Details button.

This will be identical to the first subroutine except that you'll use the value of each cell to set the Default parameter of each input box.

Attach the subroutine to the Edit Details button.  Click the button to test that the system works.

Edit details

Each input box should appear with the current value already displayed.


Save and close the file.

This page has 0 threads Add post