ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Message Box (https://www.excelbanter.com/excel-programming/306041-message-box.html)

Powlaz

Message Box
 
Is there a way to incorporate a message box into a
simple "If" statement? I don't know enough to use vbcode
with Excel. I just use the built in functions. I need
to incorporate a message box into one of my "if
statements".

David C.

Message Box
 

I need
to incorporate a message box into one of my "if
statements".


Well, i do not really understand the point.
do you want to test the result of the button clicked ?

Because if the problem is just to open a box under conditions it's easy:

if (condition) then
msgbox "condition true"
end if

else, the msgbox can be read
result = msgbox ( "yes or no ?", vbYesNo)
msgbox result

and the help of msgbox will give you all the possible values (vbYes or vbNo
for example)




Powlaz

Message Box
 
I see what you are saying but I do not go to the code
page to make things happen. I'm not very well versed. I
select a cell and then chose a function. It is from here
that I wanted the message box to be programmed in. Is
this possible?
-----Original Message-----

I need
to incorporate a message box into one of my "if
statements".


Well, i do not really understand the point.
do you want to test the result of the button clicked ?

Because if the problem is just to open a box under

conditions it's easy:

if (condition) then
msgbox "condition true"
end if

else, the msgbox can be read
result = msgbox ( "yes or no ?", vbYesNo)
msgbox result

and the help of msgbox will give you all the possible

values (vbYes or vbNo
for example)



.



All times are GMT +1. The time now is 11:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com