我有一个VBA代码,它首先删除工作簿中的所有表,并在循环中在excel中创建新表,现在它一次制作大约1000个表。目前我有下表#{1作为表的名称。
问题是否会在表格的唯一名称用完之后出类拔萃?
出现这个问题是因为我会一次又一次地运行同样的过程,所以这会成为一个问题吗?
如果是,我该如何避免呢?
答案 0 :(得分:6)
是的,Excel将耗尽表名。正如Jules所说(并且可以通过在Excel中尝试长名称来确认),Excel表名限制为255个字符(截至写作 - 我使用Excel 2010)。因此,可用的表名数量有限。
然而,可能性非常非常高。由于某些组合是不允许的,因此字母和数字的组合并不是最多255个字符串,例如也可能是单元格引用的名称(表名" T100"不允许使用也可能意味着细胞T100)。
假设您继续命名"表1和#34;到"表 N ": 您最大的表名是
Table9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
如果您每秒添加 100亿个表,则可以为
添加表格1,157,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407,407 的天强>
根据Sydney Observatory,地球将在你的桌名耗尽之前被太阳吞没。
如果我犯了错误,请随意检查我的数学错误:
9,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999 /(100,000,000,000 * 60 * 60 * 24)