VBA使用UBOUND多维数组 [英] VBA using ubound on a multidimensional array

查看:2781
本文介绍了VBA使用UBOUND多维数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

UBOUND可以返回数组的最大索引值,但在一个多维数组,我怎么会指定尺寸我想的最多的索引?

例如

 暗淡ARR(1至4,1至3)变

在此4x3的阵列中,我将如何有UBOUND返回4,我怎么会UBOUND回报3?


解决方案

  UBOUND(ARR,1)

  UBOUND(ARR,2)

Ubound can return the max index value of an array, but in a multidimensional array, how would I specify WHICH dimension I want the max index of?

For example

Dim arr(1 to 4, 1 to 3) As Variant

In this 4x3 array, how would I have Ubound return 4, and how would I have Ubound return 3?

解决方案

ubound(arr, 1) 

and

ubound(arr, 2) 

这篇关于VBA使用UBOUND多维数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆