Need help displaying array contents

  • Thread starter Thread starter jsatz
  • Start date Start date
J

jsatz

I have an array of strings that I'm wanting to display to the user. All
I've been able to do is use the MsgBox command in a loop to display
things one at a time, but I can only get MsgBox to display one line at
a time.

I want to be able to show all my results in one message box that pops
up for the user.

My array basically contains results from a spreadsheet update macro
(basically a log file).

Thanks.
 
One way:

Dim i As Integer
Dim msg As String
For i = LBound(sArr) To UBound(sArr)
msg = msg & vbNewLine & sArr(i)
Next i
MsgBox Mid(msg, 2)

where sArr is your array of strings.
 
Back
Top