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
542 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 ==> | Arrays (4 exercises) |
Level ==> | Harder than average |
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 RRH Maze.xlsx file and create a new script.
The aim of the exercise is to loop through arrays of special cells to modify them.
Little Red Riding Hood is sick of traipsing through the mud to get to Grandma's cottage; she'd prefer a nice paved road to walk along.
Use the getSpecialCells method to capture the blank cells in the range B1:G7.
Apply the getAreas method to return the separate blocks of blank cells to an array. Loop through the array and change the fill colour of each range area to darkgray.
That should make for a smoother journey.
A development company has procured logging rights to the forest and intends to cut it down. However, a population of the endangered grey wolf means that some areas can't be logged.
You can't chop down a forest area if a wolf lives in it.
Use the getValues method to read the contents of the forest range into an array.
Loop through the array of values, checking for wolves (see the image and hint below for different ways to do this). If you don't find a wolf, change the value of the array element to an empty string.
You can insert emoji in an Office Script. To do this, hold the Windows key and type a full stop to display the emoji panel. Search for the wolf emoji and insert it into the script.
An alternative way to check for wolves is to loop through the individual characters of the string, checking if each one corresponds to the Unicode character number 55357. You can use the charCodeAt method to do this.
After the loop, write the contents of the array to the range of cells using the setValues method.
The sad result.
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.