ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   msgbox yes or no (https://www.excelbanter.com/excel-programming/327127-msgbox-yes-no.html)

choice[_2_]

msgbox yes or no
 
MsgBox Range("sale!hr2").Value, vbYesNo

If vbYes Then
MsgBox "yes", vbOKOnly
End If
If vbNo Then
MsgBox "no", vbOKOnly
End If

it does both yes and no, im sure im missing something simple...i just dont
know what it is

thanks in advance

Toppers

msgbox yes or no
 
reply= MsgBox(Range("A1").Value, vbYesNo)

If reply = vbYes Then
MsgBox "yes", vbOKOnly
Else
MsgBox "no", vbOKOnly
End If


HTH

"choice" wrote:

MsgBox Range("sale!hr2").Value, vbYesNo

If vbYes Then
MsgBox "yes", vbOKOnly
End If
If vbNo Then
MsgBox "no", vbOKOnly
End If

it does both yes and no, im sure im missing something simple...i just dont
know what it is

thanks in advance


John[_88_]

msgbox yes or no
 
Dear Choice,

Try this:

If MsgBox(Range("sales!hr2"), vbYesNo) = vbYes Then
MsgBox "Yes"
Else
MsgBox "No"
End If

Best regards

John

"choice" wrote in message
...
MsgBox Range("sale!hr2").Value, vbYesNo

If vbYes Then
MsgBox "yes", vbOKOnly
End If
If vbNo Then
MsgBox "no", vbOKOnly
End If

it does both yes and no, im sure im missing something simple...i just dont
know what it is

thanks in advance





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

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