动态阵列名称 [英] Dynamic Array Name

查看:92
本文介绍了动态阵列名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有办法制作一个数组,并根据变量给它命名?

I'm wondering if there is a way to make an array and give it a name based on a variable?

例如,如果我有4个玩家(玩家1) ,玩家2,玩家3和玩家4)我想为每个玩家制作一个数组,有没有办法创建一个数组并给它相应的玩家的名字?例如Player1(5)  Player2(5)Player3(5)和
Player4(5)

For example if I have 4 players (player 1, player 2, player 3 and player 4) and I want to make an array for each player, is there a way to create an array and give it the name of the respective player? For example Player1(5)  Player2(5) Player3(5) and Player4(5)

有一种方法可以将值1到4存储在一个变量中并将其连接到"Player"。创建完整的名字?

is there a way to store the values 1 through 4 in a variable and concatenate that to "Player" to create the complete name?

我知道我可以创建一个二维数组并将玩家名称存储在数组中但是我想知道我是否可以这样做。

I know I can make a 2 dimensional array and store the players name in the array but I am wondering if I can do it this way.

这也与Excel无关,只是直接VBA

Also this has nothing to do with Excel, just straight VBA

谢谢

推荐答案

不,您不能在运行时动态命名VBA变量,只能在设计时。
No, you cannot name VBA variables dynamically in runtime, only in design time.


这篇关于动态阵列名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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