ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   List of text in a message box arranged in rows (https://www.excelbanter.com/excel-programming/432063-list-text-message-box-arranged-rows.html)

Moises

List of text in a message box arranged in rows
 
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 ?
--
Moises

Jacob Skaria

List of text in a message box arranged in rows
 
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

--
If this post helps click Yes
---------------
Jacob Skaria


"Moises" wrote:

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 ?
--
Moises



All times are GMT +1. The time now is 08:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com