With 20 elements, it will be long and ugly, but you can do this,<br><br>If your Array was called varTest():<br><br>MsgBox varTest(1) & vbNewLine & varTest(2) & vbNewLine & varTest(3) & vbNewLine & varTest(4) & vbNewLine & varTest(5) ..... etc.<br><br>This will work, I tried it. I will let you know if I come up with a different solution.<br><br>HTH<br> <p>Jim Lunde<br><a href=mailto:compugeeks@hotmail.com>compugeeks@hotmail.com</a><br><a href=
Given varTest(X) is the array, and the first array number was 0.<br>You could do this if you wanted to have the items separated by a comma<br><br> Dim strMsg As String, i As Long<br> <br> Do Until X = -1<br> strMsg = varTest(X) & ", " & strMsg<br> X = X - 1<br> Loop<br> i = Len(strMsg)<br> strMsg = Left(strMsg, i - 2) ' trim trailing comma<br> MsgBox strMsg<br><br>or you could change & ", " to & vbCrLf if you wanted a new line, and then remove the <br>i = Len(strMsg) and the line to trim the comma
Thanks alot guys for the tip. Since the array was filling up with values that have been selected in a list box,I used the following looping structure:<br><br>For each counter in myListBox.ItemsSelected<br> myArray(counter) = myListBox.Column(1,[counter]) <br> strMsg = myArray(counter) & "," & strMsg<br> counter = counter + 1<br>Next counter<br><br> Response = MsgBox(strMsg,vbYesNo,Title)<br><br>'use IF statement to execute code based on vbYesNo
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.