动态阵列名称

编程入门 行业动态 更新时间:2024-10-08 03:38:07
本文介绍了动态阵列名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

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.

更多推荐

动态阵列名称

本文发布于:2023-07-22 00:49:54,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1182563.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:阵列   名称   动态

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!