Read our blogs, tips and tutorials
Try our exercises or test your skills
Watch our tutorial videos or shorts
Take a self-paced course
Read our recent newsletters
License our courseware
Book expert consultancy
Buy our publications
Get help in using our site
549 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owl trainers only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
Search our website
We also send out useful tips in a monthly email newsletter ...
Software ==> | OfficeScripts (21 exercises) |
Topic ==> | Conditional statements (2 exercises) |
Level ==> | Average difficulty |
Subject ==> | Office Scripts training |
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.
Open the WODA Application.xlsx file and add a new script. The aim of this exercise is to validate the user inputs before adding them to the list of applications.
Some validation code is needed here.
Create if statements to check that the Apply and List worksheets exist. If not, use the console.log statement to print a warning message and then exit from the script.
The code should stop if either of these worksheets is not in the workbook.
Add an if statement to check that the user has entered a name. If the cell is empty, show a message in the cell next to it and exit from the script. Include an else clause to clear the message when a name has been entered.
Your error message could look like this.
Add if statements to check that the height has been entered as a number and that the number is not less than 0. Display an appropriate error message and exit the script if the value entered doesn't conform to your rules.
Make sure the error message is cleared when a valid number is entered.
Add another if statement to check that a valid date has been entered into cell C6. Display an error message and exit from the script if not.
You can check if the Date.parse method returns a number to check if the value is a date. You may find it useful to change to number format of the cell before you do this.
Once all the validation has been passed, add code to copy the details to the end of the list on the List sheet.
Save and close the script and the workbook.
You can find other training resources for the subject of this exercise here:
Kingsmoor House
Railway Street
GLOSSOP
SK13 2AA
Landmark Offices
99 Bishopsgate
LONDON
EC2M 3XD
Holiday Inn
25 Aytoun Street
MANCHESTER
M1 3AE
© Wise Owl Business Solutions Ltd 2024. All Rights Reserved.