Hello,
this may sem like a relatively simple question. hoepfully it is!
i have a text box linked to a cell, and when the text box loses focus, i have a message appear for confirmation. if the user selects 'cancel' i want to text box to clear out. any suggestions?
Private Sub TextBox1_Change() Range("A1") = TextBox1.Value End Sub Private Sub TextBox1_LostFocus() MsgBox "Is this correct?", vbOKCancel, "Confirmation" End Sub
Last edited by AppSupportKarl; 05-19-2011 at 08:16 AM.
try this:
[code]
Private Sub TextBox1_LostFocus()
Dim Answer
Answer = MsgBox ("Is this correct?", vbOKCancel, "Confirmation")
If Answer = vbCancel then
TextBox1.Value = ""
end if
End Sub
Works perfectly, thanks very much!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks