EXCEL – Message Box

03/03/2016 § Leave a comment

Message box – new line

Dim answer As Integer
answer = MsgBox(“Are you sure you want to empty the sheet?”, vbYesNo + vbQuestion, “Empty Sheet”)
If answer = vbYes Then
Cells.ClearContents
Else
‘do nothing
End If

Source:
http://www.excel-easy.com/vba/examples/msgbox-function.html

Msgbox Function in Excel VBA

=====

 

Message box – new line

MsgBox “Line 1” & vbNewLine & “Line 2”

New Line
Source:
http://www.excel-easy.com/vba/msgbox.html

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

What’s this?

You are currently reading EXCEL – Message Box at RheXenoR.

meta

%d bloggers like this: