Message Box - Yes/No
I tried what you suggested, the double click is still needed on the Yes
button. No is working fine (single click). Before using the Message Box, I
tried UserForm and had the same problem with the 'Yes' button.
--
Linda
"Mike H" wrote:
Hi,
There is nothing in the code that would require a double click but you could
try this simplified version. Note the code still selects A6 but unless you
have a particular reason for doing so i doubt it is necessary.
Sub ClearDoc()
answer = MsgBox("Do you have another Agency Billing to complete ?", vbYesNo
+ vbQuestion)
If answer = vbYes Then
Application.EnableEvents = False
Sheets("Input").Range("A6:h35").ClearContents
Application.EnableEvents = True
Sheets("Input").Range("A6").Select
Else
Sheets("Input").Range("A6").Select
MsgBox "Costs have been recorded. This file will now close", vbInformation
ActiveWorkbook.Close SaveChanges:=False
End If
End Sub
Mike
"mathel" wrote:
Hi, I am running Excel 2003 and have created a Mssg Box for a workbook that
requires a Yes / No response. For some reason, the 'Yes' response needs to
be 'double clicked' to activiate it. Can someone tell me how, or if it can
be changed to 'single click'. The code I have is:
Sub ClearDoc()
Dim response As Long
answer = MsgBox("Do you have another Agency Billing to complete ?",
vbYesNo + vbQuestion)
If answer = vbYes Then
Sheets("Input").Select
Range("A6:h35").Select
Selection.ClearContents
Range("A6").Select
Else
Sheets("Input").Select
Range("A6").Select
MsgBox "Costs have been recorded. This file will now close", vbInformation
Application.ScreenUpdating = True
ActiveWorkbook.Close SaveChanges:=False
End If
End Sub
Thanks
--
Linda
|