Can I make an alert box with with a yes/no question?

G

Guest

I'd like to create a pop-up windo that the user selects yes or no and their
response is recorded in an excel cell
 
G

Guest

You never said where you wnated to put the value. This code places the yes or
No in the first empty cell of column A on sheet 1

Sub AddMessage()
With Sheet1.Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
If MsgBox("Yes or No", vbYesNo, "Yes/No") = vbYes Then
.Value = "Yes"
Else
.Value = "No"
End If
End With
End Sub
 

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

Top