Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

Creating new table wiith a new name


Hello my workbook contains a bunch of tables , let's say 11 tables. I want my code to create automatically a new table with the name : table_number of the last table + 1

I have this issue with creating a new table and a new sheet.




In future questions, please be sure to review your question before (and after) submitting it and do NOT include the portion of text above starting "TRANSLATE with x English...".
John_Ru (rep: 3992) Jun 19, '22 at 7:34 am
Add to Discussion



Hi Aybrs and welcome to the Forum.

As far as I know, it's not possible to change Microsoft's default name for tables (e.g. Table1) for which the numeric part is incremented automatically. You can manually change a table name (subject to the naming convetion), as I guess you know.

While there's a Workbook NewChart event in VBA, there's isn't an equivalent for tables. You could create VBA code (say based on the Worksheet_Change event) but I don't think it would be worth the effort unless you plan to add lots of tables.



He seems to be spamming and doesn't realize that he can't include links yet. I banned him and will remove the spam text from both of his posts.
don (rep: 1979) Jun 19, '22 at 10:43 am
Oh okay Don. I took him seriously :(
John_Ru (rep: 3992) Jun 19, '22 at 11:20 am
Add to Discussion

Answer the Question

You must create an account to use the forum. Create an Account or Login