Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Will Excel run out of table names ever?

Tags:

excel

vba

I have a VBA code that first deletes any tables that are in the workbook and creates new tables in excel in a loop and right now it is making about 1000s of them at once Currently I have the following table no.Table59860171 as the name of a table.

Question is will excel at any point run out of unique names for a table ?

This question arose because I'll be running this same process again and again so can this be a problem ?

If yes how can I avoid it ?

like image 431
Stupid_Intern Avatar asked Jan 29 '26 02:01

Stupid_Intern


1 Answers

Yes, Excel will run out of table names. As Jules notes (and can be confirmed by trying long names in Excel), Excel table names are limited to 255 characters (as of the time of writing- I'm using Excel 2010). So, there is a finite number of table names available.

However, the number of possibilities is very, very high. It is not quite every combination of letters and numbers up to a 255 character string since some combinations are not allowed, such as names that could also be a cell reference (the table name "T100" is not allowed as it could also mean cell T100).

Assuming that you continue naming tables from "Table1" to "TableN": Your largest table name would be

Table9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999

If you added 100 Billion tables every second, you could add tables for

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 days.

According to Sydney Observatory, the Earth will be engulfed by the Sun long before you ever run out of table names.


Feel free to check my math- correct me if I've made a mistake:

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)

like image 87
elmer007 Avatar answered Jan 30 '26 20:01

elmer007