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 Display Alerts In Excel

When creating or deleting a Worksheet in Excel you don't want Excel to inform you "A file already exists....." Or "Do you want to save this file...".

To stop these alerts happening use the following line of code:

Application.DisplayAlerts = False

After the Create or Delete routine use:

Application.DisplayAlerts = True

View all VBA hints and tips

Excel training
Course rating
4.7 stars - based on 24710 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