EXERCISE TOPIC▼
- Access exercises (91)
- C# exercises (79)
- Excel exercises (278)
- Power Apps exercises (13)
- Power Automate exercises (18)
- Power BI exercises (139)
- Power Platform exercises ()
- Python exercises (28)
- Report Builder exercises (141)
- SQL exercises (198)
- SSAS exercises (51)
- SSIS exercises (46)
- SSRS exercises (99)
- VBA exercises (85)
- Visual Basic exercises (46)
VBA EXERCISES▼
ADVANCED VBA EXERCISES▼
Advanced VBA | FileSystemObjects exercise | Collating the results of a questionnaire using FileSystemObjects
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.
Software ==> | Advanced VBA (33 exercises) |
Version ==> | Any MS Office versions |
Topic ==> | FileSystemObjects (4 exercises) |
Level ==> | Average difficulty |
Subject ==> | VBA training |
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.
The folder shown above contains 43 files. Each one is the response of one region of England and Wales to an attitudes survey that you sent out:

We're particularly interested in the named range Q4Range, shown selected above.
Write a macro which loops over all of the workbooks in this folder. For each workbook, it should:
- Check if the reply to the Daily Mail question is Yes;
- If it is, write out the name of the area to the immediate window;
- Close the workbook down, without saving any changes.
Don't forget to create a reference to the Microsoft Scripting Runtime object library first!
Here's what you should get as a result of running your macro:

The first few of the 16 regions who voted to ban the Daily Mail (fighting illiberalism with illiberalism?).
Save your workbook as The Great Satan, then close it down.