How do I create a macro to automatically click message boxes like YES or OK ?

  • Thread starter Thread starter Jim
  • Start date Start date
J

Jim

Many, Many thanks for your help ...

1) How do I create a macro to automatically click message boxes like
YES or OK ?

2) Is there away as well to pre-select my choice (YES over no, for
example ...) ?

Much Appreciated !
jim
 
Jim,

1) Could you give an example of what you are trying to do here? The
idea of automatically clicking a message box doesn't make sense tome at
the moment... why have a message box at all?
2) There is a number coding system you can use with the MsgBox()
function to set the Default Button. The first button is always the
default, unless you specify otherwise. For example the value for the
second button to be default is 256. So as an example, you can use...
MsgBox("Your Message",308,"Title")
.... where the 308 results from 4+48+256 where 4 means use Yes and No
buttons, and 48 means show Exclamation icon, and 256 means second button
(No) is default. See Help on MsgBox function for more information.
 
Back
Top