Data from cell viewed in message box

P

Peruanos72

Hello all,

Anyone know how to take data from any give cell(s) and place in a message box?
I have 2 cells (J9 and J19) and i want this data in the message box.

Dim ans As Long
ans = MsgBox("Supervisor Name: (CELL VALUE J19) & Agent Name: (Cell VALUE
J9). Is this correct?", vbYesNo + vbQuestion)

Thx in advance!!!
 
F

FSt1

hi
this works in 03
Sub messinbot()
Dim ans As Long
Dim r As String
Dim s As String
r = Range("J19").Value
s = Range("J9").Value
ans = MsgBox("Supervisor Name: " & r & " & Agent Name: " & s & _
". Is this correct?", vbYesNo + vbQuestion)
End Sub

regards
FSt1
 
C

CurlyDave

hi
this works in 03
Sub messinbot()
Dim ans As Long
Dim r As String
Dim s As String
r = Range("J19").Value
s = Range("J9").Value
ans = MsgBox("Supervisor Name: " & r & " & Agent Name: " & s & _
    ". Is this correct?", vbYesNo + vbQuestion)
End Sub

regards
FSt1

Something needs to happen when you select yes or no


Sub messinbot()
Dim ans As Long
Dim r As String
Dim s As String
r = Range("J19").Value
s = Range("J9").Value
ans = MsgBox("Supervisor Name: " & r & " & Agent Name: " & s & _
". Is this correct?", vbYesNo + vbQuestion)
If ans = vbYes Then MsgBox "You selected Yes"
If ans = vbNo Then MsgBox "You selected no"
End Sub
 
P

Peruanos72

That did it. Thanks!!!

FSt1 said:
hi
this works in 03
Sub messinbot()
Dim ans As Long
Dim r As String
Dim s As String
r = Range("J19").Value
s = Range("J9").Value
ans = MsgBox("Supervisor Name: " & r & " & Agent Name: " & s & _
". Is this correct?", vbYesNo + vbQuestion)
End Sub

regards
FSt1
 

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