Ubound with Muliple Columns

Rocky0201

Active Member
Joined
Aug 20, 2009
Messages
278
Hi..

I have defined vAry as a Variant. I ReDim this to have 2 columns:

ReDim vAry(330,38)

How do I use Ubound on the second column only (the 38 element column)?

I am trying to use a For loop but only on the second column.

For I = 1 to vAry(???)

This this possible?

If I code Ubound(vAry(0,0)) i receive Type mismatch.

Thanks...
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Hello Rocky0201,

The UBound takes 2 arguments: The array name and the dimension number. In your array vAry(330,38), the upper boundaries are dimension 1 is 330, and dimension 2 is 38. Your code then would be...
For I = 1 to UBound(vAry, 2)​
 
Upvote 0
Hello Rocky0201,

You're welcome. If you have your VBA Help files installed you can find this information there also.
 
Upvote 0

Forum statistics

Threads
1,217,035
Messages
6,134,123
Members
449,861
Latest member
DMJHohl

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top