Cell Value in a MsgBox

P

PCH

How do I include a cells value in a message box?

i.e.
Msg = "Are you sure you want to delete Quantities? & Cell (A1) Value Here"


Sub Macro1()

Dim Msg, Style, Title, Response, MyString
Msg = "Are you sure you want to delete Quantities? " ' Define message.
Style = vbYesNo + vbExclamation + vbDefaultButton2 ' Define buttons.
Title = "Last Chance!!!" ' Define title.
Response = MsgBox(Msg, Style, Title)

If Response = vbYes Then

Range("B7:B27,B30:B40,B43:B51,B54:B66,D7:D13,D16,D19:D50,D53:D66,F7:F60,i3").
_
Select
Range("F7").Activate
Selection.ClearContents
Range("B3:D3").Select
Else ' do nothing.
End
End If

End Sub
 
F

Franz Verga

PCH said:
How do I include a cells value in a message box?

i.e.
Msg = "Are you sure you want to delete Quantities? & Cell (A1) Value
Here"

Try with this:

Msg = "Are you sure you want to delete Quantities? & Range("A1").Value


--
Hope I helped you.

Thanks in advance for your feedback.

Ciao

Franz Verga from Italy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top