Easy VBA Syntax Question

  • Thread starter Thread starter Hulk
  • Start date Start date
H

Hulk

I have a macro that pauses for a user response. A dialog box comes u
saying "The selection contains multiple data values. Merging into on
cell will keep the upper-left most data only." At this point, I can hi
OK and it will continue.

How can I automate this so it automatically selects OK?

Thank you
 
Place the following around your code that does the merge:

Application.DisplayAlerts = False

'Your Code

Application.DisplayAlerts = True
 
I think this is how it works...

MsgBox "This is default button",vbYesNo + vbDefaultButton2,"Try It N See"

vbDefaultButton2 designates the second button (NO) as the default button.

doco
 
oops! Misunderstood the question ... sorry.

Don Cossitt said:
I think this is how it works...

MsgBox "This is default button",vbYesNo + vbDefaultButton2,"Try It N See"

vbDefaultButton2 designates the second button (NO) as the default button.

doco
 
If you want it to automatically select OK, why have the dialog box at all?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top