![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Feb 2002
Posts: 4
|
Is this possible? As my code goes through a worksheet looking for problems, I would like to collect the information in an array. At the end, I want a single MsgBox to show all of the values (elements) in the array.
|
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Denver, Colorado USA
Posts: 4,014
|
Hi Tim,
Yes, you can easily do this. Just concatenate the text you want to display for each item onto the previous text, putting a linefeed-carriage return between each. For example, say you have an account number that is a text string that you want to put in the array every time a problem occurs with that account, and that account number is in a string variable named AcctNo. Define another string variable MsgArray. Each time a problem occurs, add it to the MsgArray string: MsgArray = MsgArray & vbCrLf & AcctNo Now at the end of the program display the message: MsgBox MsgArray, _ vbExclamation, _ "Problem Account List"
__________________
Keep Excelling. Damon VBAexpert Excel Consulting (My other life: http://damonostrander.com ) |
|
|
|
|
|
#3 |
|
New Member
Join Date: Nov 2011
Posts: 3
|
found the solution:
If search_results Is Nothing Then ... End if |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|