![excel vba debug print array elements excel vba debug print array elements](https://i.stack.imgur.com/65kAg.png)
My routine can print the first value in each row of the array, but I am not sure how to print the last value in each row of the array, as the number of columns containing values changes with each row.Īny advice would be greatly appreciated.
Excel vba debug print array elements code#
Is there some way I can modify this code to create a two dimensional jagged array instead (assuming this is possible).
![excel vba debug print array elements excel vba debug print array elements](https://1.bp.blogspot.com/-TqPjJLIP5ck/YFSWWP26-dI/AAAAAAAAB5s/GJeOmu1Y9PwYo9DutO0i-GYjad57zM_XACLcBGAsYHQ/s0/Pic%2B6.png)
Long, String, Double ' Sub PrintToImmediateWindow (coll As Object) Dim i As Long For i 0 To coll.Count - 1 Debug. Or if you thought ahead, you could add a sub that you can modify as needed, even while sitting at a breakpoint in most cases, and have it use Debug.Print to print out data in any format you want. ' Print all items to the Immediate Window (Ctrl + G) ' Items must be basic data type e.g. You might want to use an in-line loop to dump a range of values. The trouble is it is a ordinary rectangular two dimensional array. Re: Check array element values in immediate window. NET enables developers to create, write, edit, convert, print, handle and read. Public Sub TestLoopArray() 'declare the array Dim rnArray() As Variant 'Declare the integer to store the number of rows Dim iRw As Integer 'Assign range to a the array variable rnArray Range('A1:A10') 'loop through the rows - 1 to 10 For iRw 1 To UBound(rnArray) 'output to the immediate window Debug. dim possible (1 to 9, 1 to 9) as variant dim l as long dim i as long, j as long for i lbound (possible, 1) to ubound (possible, 1) for j lbound (possible, 2) to ubound (possible, 2) if isempty (possible (i, j)) then debug. Sub PutCellContentsIntoTwoDimensionaArray()ĭim i As Integer, j As Integer, cnt As Integer This documentation describes: How to build, run, debug Visual Basic 6.