Include cell text in MsgBox ??

D

dim

Hi folks,

Is there a way I can include the text contained within a cell in my message
box.

Something like?

Sub ShowEmployeeName ()
NameValue = Range("A1").Value
AgeValue = Range("A2").Value

MsgBox "The employee (NameValue), is (AgeValue).", vbOkOnly + vbInformation,
"Employee"
End Sub

Thanks for any ideas....
 
T

tc

Hi folks,

Is there a way I can include the text contained within a cell in my message
box.

Something like?

Sub ShowEmployeeName ()
NameValue = Range("A1").Value
AgeValue = Range("A2").Value

MsgBox "The employee (NameValue), is (AgeValue).", vbOkOnly + vbInformation,
"Employee"
End Sub

Thanks for any ideas....

Dim NameValue As String, AgeValue As String

NameValue = Range("A1").Value
AgeValue = Range("A2").Value

MsgBox ("The employee " & NameValue & " is " & AgeValue)
 

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

Similar Threads


Top