access vba course - vba message box
Request a callback

We'll call during UK business hours

0207 987 3777

Forum home » Delegate support and help forum » Microsoft VBA Training and help » access vba course - Vba Message Box

access vba course - Vba Message Box

resolvedResolved · Low Priority · Version Standard

Mon 9 Jul 2007, 11:38 replyReply Delegate Dimitrios said...

Dimitrios has attended:
Excel Advanced course
Excel VBA Intro Intermediate course

Vba Message Box


I would like to create a message box where it will say: "Copy yesterday's data?". If the user replies yes, then i want it to execute the macro that i have created in VBA (named Main) eitherwise do nothing. So far, my macro lloks like this:

Sub Main()

Application.ScreenUpdating = False
Exit Sub

Dim reply As Integer

reply = MsgBox("Copy Yesterday's Data?", vbYesNo)
If reply = vbYes Then

End If

I am not sure what to add after the THEN in order to make it run the MAIN sub. any help will be greatly appreciated.

For upcoming training course dates see: Pricing & availability

Wed 11 Jul 2007, 15:43 replyReply Trainer Carlos said...

RE: Vba Message Box


After the THEN you enter the following line:

Call Main

This runs the Main macro.




Vba tip:

Stop Screen Flickering When Running Code

Running VBA code may cause the screen to flicker as the monitor is the slowest part of the program and cannot keep up with the very fast changes taking place.

To switch off the screen until the program is run enter the following code line:

Application.ScreenUpdating = False

The screen comes on automatically on completion of the program.

View all VBA hints and tips

Training courses
London & UK

Live dates & prices »

On-site training

Get a quote »


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.

Excel training
Course rating
4.7 stars - based on 26421 reviews
Microsoft Certified Partner Institute of Leadership and Management - Certified Courses Learning and Performance Institute - Accredited Training Provider Security Seal verified by visa, mastercard securecard

Connect with us: Google+ · Facebook · Twitter · LinkedIn · Pinterest

2nd Floor, CA House, 1 Northey Street
Limehouse Basin, London, E14 8BT
United Kingdom

Excel courses in London