adding new workbooks

Forum home » Delegate support and help forum » Microsoft Access VBA Training and help » Adding new workbooks

Adding new workbooks

resolvedResolved · Low Priority · Version 2007

John has attended:
Excel VBA Intro Intermediate course

Adding new workbooks

Good morning!

I was revisiting the course material for VBA Intro and Intermediate, and just wanted clarity on when is the best case to use the If Then or the Select Case process?

For example, if the process only had a few (less than 5) options then would you use the If then function otherwise use the Select Case function? Are either faster running than the other or is the Select Case easier to follow?

Much appreciate your help?

John

RE: Adding new workbooks

Hi John

Thanks for getting in touch, good to hear from you.

As a general guide, I would consider the IF... THEN when I have 3 or fewer options to choose between.

Any more than that, and I would use the SELECT CASE. It is easier to read and arguably write (for humans). I haven't seen any direct research comparing the speed of the methods.

The only possible downside to SELECT CASE is that you have to test the same object in every scenario. Most of the time you will be doing that but it's worth bearing in mind if your IF decision has to branch out and test different objects conditionally.

Kind regards

Gary Fenn
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
Best STL - https://www.stl-training.co.uk
98%+ recommend us

London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector

Wed 28 Nov 2012: Automatically marked as resolved.

 

Training courses

 

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Access tip:

Pop up property

If you want to focus the attention of a form / switchboard to a user then you can change the propeties of a form/switchboard for Pop up to On.

This meand tht the focus for the user must be on the form / switchboard

View all Access hints and tips


Server loaded in 0.11 secs.