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
560 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 ==> | Referring to ranges (5 exercises) |
Level ==> | Relatively easy |
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.
Using either the online or the desktop version of Excel, open the Battleships game.xlsx file in the folder shown above. Welcome to the Wise Owl version of Battleships!
Create a new Office Script and give it a sensible name, for example Ex01 Battleships. Save the script in a folder of your choice.
Write an instruction to "sink" the submarine in cell A3 by changing its fill colour. Use the getRange method to reference the cell.
Write another instruction to do the same to cell H4 using the getCell method. Remember that rows and columns are numbered from zero!
Run the script to check the accuracy of your targeting.
Two direct hits!
Add a new instruction to change the colour of the destroyer in cells C4:C6 using the getRange method.
Add another instruction to do the same to the destroyer in cells F8:H8 using the getRangeByIndexes method.
Write one more instruction to change the colour of the named range Battleship using the getRange method.
Run the script and check that you've changed the correct cells.
Mission accomplished.
Save the script and the workbook, then close the file.
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.