Can MsgBox Do This??

F

foamfollower

Hello,
Thanks for any help in advance. just when i'm getting ready to
upgrade myself
from pion to junior-grade programmer, i get stumped on an easy
one....probably.

here it is:

I copy a data set to a sheet. on that sheet, i have five cells, F2:F6
that
contain a COUNTIF formula and a TEXT argument that analyze specific
data and
return a value as a number with a text string. example of returned
value: 2 rolls exceeding cv threshold. now, thats simple enough
(even for me)

what i need is a MessageBox that appears immediately after data is
copied to the sheet that tells the operator the results in the cells
F2:F6. and i only have to have the operator click "OK" and end it
there. i can insert text in a
message box all day long, but i can't figure out how to display the
result of
a cell, or in this case, a range of 5 cells.

Thanks once again! any help is greatly appreciated.

LiveLongAndProsper

SF
 
M

mudraker

for a single cell

MsgBox Range("a1").Value


for multiple cell with each value dispolayed on a separte line

MsgBox Range("a1").Value & Chr(10) _
& Range("a2").Value & Chr(10)
& Range("a3").Value & Chr(10)
 
G

Guest

Hi

Another option.

Sub aaa()
For Each Item In Range("f2:f6")
dataa = dataa & Item & Chr(10)
Next Item

MsgBox dataa
End Sub

Tony

----- foamfollower wrote: -----

Hello,
Thanks for any help in advance. just when i'm getting ready to
upgrade myself
from pion to junior-grade programmer, i get stumped on an easy
one....probably.

here it is:

I copy a data set to a sheet. on that sheet, i have five cells, F2:F6
that
contain a COUNTIF formula and a TEXT argument that analyze specific
data and
return a value as a number with a text string. example of returned
value: 2 rolls exceeding cv threshold. now, thats simple enough
(even for me)

what i need is a MessageBox that appears immediately after data is
copied to the sheet that tells the operator the results in the cells
F2:F6. and i only have to have the operator click "OK" and end it
there. i can insert text in a
message box all day long, but i can't figure out how to display the
result of
a cell, or in this case, a range of 5 cells.

Thanks once again! any help is greatly appreciated.

LiveLongAndProsper

SF
 
R

RB Smissaert

Put this in the worksheet code (right-click the particular sheet in VBE and
do view code):

Private Sub Worksheet_Change(ByVal Target As Range)

Dim i As Byte
Dim strMessage As String

Set Target = Range(Cells(2, 6), Cells(7, 6))

For i = 2 To 6
strMessage = strMessage & Cells(i, 6) & vbCrLf
Next

If Not Intersect(ActiveCell, Target) Is Nothing Then
MsgBox strMessage, , ""
End If

End Sub


RBS
 

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