BigDave wrote:
> Here's the code I'm dealing with:
>>
>> Dim varAnswer As String
>>
>> varAnswer = MsgBox("This cannot be undone." & Chr(10) & Chr(10) &
>> "Edits to this workbook my only be entered into your Data Sheet
>> manually once the current data is compiled.", vbOKCancel)
>> If varAnswer = vbCancel Then
>> Exit Sub
>> End If
Not what you asked, but...
Dim lngAnswer as Long
lngAnswer = MsgBox(etc...)
Your variable's prefix makes it look like a Variant data type (although it
may mean variable), is dimmed as a String data type, and MsgBox returns a
Long Integer. Consider shoring all that up as above.
--
**** Kusleika
MVP - Excel
Excel Blog - Daily Dose of Excel
www.*****-blog.com
Bookmarks