List of text in a message box arranged in rows

M

Moises

I need to create a message that is activated with a macro, in the message I
need to put a listo of items organised by rows, for example "

Inventory Control - WH1 - INFO
Item 1
Item 2
Item 3
..
..

OK

How do I have to wite the code in the message box :
MsgBox "Item 1", vbMsgBoxRtlReading, "MMR"

to include the other rows and they are displayed in rows on the screen ?
 
J

Jacob Skaria

Withe your items in ColA from row2 to row10 try the below macro....Adjust to
suit

Sub Macro1()

Dim lngRow As Long
Dim strMessage As String
For lngRow = 2 To 10
If Trim(Range("A" & lngRow)) <> "" Then _
strMessage = strMessage & vbLf & Range("A" & lngRow)
Next
MsgBox strMessage

End Sub
 

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