View Array Contents

G

Guest

Often I need to see the contents of my array to verify that I am doing things
correctly. About the only ways I know how to do this is the "Hover" method
where the yellow popup will come over the currently-pointed to array. But
the popup doesn't always work and besides, it only shows me the value of the
array for the elements that are set and I want to "browse" the entire
contents of the array. Is this possible?
 
C

Chip Pearson

While your code is sitting on a break point or what for an F8 to step next,
go to the Debug window, choose Add Watch and eneter your array variable
name in the Expression to watch. This will display the current and changing
values of the array. Click the "+" symbol in the Watch window to view a list
of all elements of the array and their values.
 
C

Chip Pearson

You can also type the following in the Immediate window while you are at a
break point or wait on a step:

for n = 1 to 3 : debug.Print v(n) :next n

Change 'v' to the name of the array ane change 1 and 3 to the lower and
upper elements you wish to view.

--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top