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 ==> | Functions (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 WODA Functions script.
Feel free to replace the sample details with your own.
The aim of the exercise is to create functions to validate the user input on the Apply worksheet.
We'll start with a function which checks if the provided cell is empty.
Create a function called cellIsEmpty which accepts an ExcelScript.Range object as an argument and returns a boolean value.
Add code to the function to check if the cell passed to it is empty. If so, change the cell's fill colour to red and return the value true, otherwise clear the cell's fill colour and return the value false.
Run the script and test that it works.
Use the same function to check if the cell containing the user's height has been filled in.
Add a second call to the function at this point.
Add a new function to test if a cell contains a positive number. The function should accept an ExcelScript.Range object as an argument and return a boolean value.
Add code to the function so that it returns true if the value of the cell is a positive number, otherwise it should change the cell's colour and return false.
Call the new function to check that the cell containing the user's height has a valid number. If the function returns false you should exit from the main function.
Add a new function to test if a cell contains a valid date. If not, the function should format the cell passed to it and return an appropriate value.
You can use the Date.parse method to check if a string represents a valid date. If the method does not return a number, the string does not represent a date.
Call the function at the point shown below and exit from the main function if the date cell doesn't contain a date.
Call the new function after setting the cell's number format.
Check that your validation functions work as intended then save and close the script and 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.