Hi EMoe,

That should have been:

Sub ClearWorksheetArea()
If MsgBox("Are you sure you want " _
& "to clear the cells?", _
vbYesNo) = vbYes Then
Range("A1:I50").Clear
Range("K1").Select
Else
'Do something?
End If
End Sub

---
Regards,
Norman



"Norman Jones" <normanjones@whereforartthou.com> wrote in message
news:OrVAdSHdFHA.2588@TK2MSFTNGP15.phx.gbl...
> Hi EMoe,
>
> Try:
>
> Sub ClearWorksheetArea()
> If MsgBox("Is there more?", vbYesNo) = vbYes Then
> Range("A1:I50").Clear
> Range("K1").Select
> Else
> 'Do something?
> End If
> End Sub
>
>
> ---
> Regards,
> Norman
>
>
>
> "EMoe" <EMoe.1qupic_1119146704.6583@excelforum-nospam.com> wrote in
> message news:EMoe.1qupic_1119146704.6583@excelforum-nospam.com...
>>
>> Good Evening!
>>
>> I have a simple code that clears a selected area on a worksheet.
>>
>> How do add to this code to prompt a message box, "Are you sure you want
>> to clear the cells". Yes will continue on to clear the cells, No would
>> return back to the sheet without clearing the cells.
>>
>> Code to clear:
>>
>> Sub ClearWorksheetArea()
>> Range("A1:I50").Clear
>> Range("K1").Select
>> End Sub
>>
>> Thanks,
>> EMoe
>>
>>
>> --
>> EMoe
>> ------------------------------------------------------------------------
>> EMoe's Profile:
>> http://www.excelforum.com/member.php...o&userid=23183
>> View this thread:
>> http://www.excelforum.com/showthread...hreadid=380355
>>

>
>