it has about 40 columns, and everyday i have to give unique 'table' names to every column, and everyday the names are different so i cant use anything automatic sadly.
so right now, every morning i load the file, mark column A, give it a unique 'name', press 'enter', use the mouse again to go and mark the next column B, use the mouse again to go to the table name area, give it a name, enter... etc.... etc..
as u can see it takes long, and for no reason.
i was wondering if theres a way to create some Macro that ill enable it only when im using this file, and every time ill press "enter" it'll automatically mark the next column (a-b-c-d) and go back to the table name area - and then all ill have left to do is just type the next name and press enter everytime ...
Dim sNewName As String
Dim oLo As ListObject
For Each oLo In ActiveSheet.ListObjects
Application.Goto oLo.Range.Cells(1, 1)
sNewName = ""
sNewName = InputBox("Please enter the new name for this table", "New table name", oLo.Name)
If Len(sNewName) > 0 Then
oLo.Name = sNewName
my main goal is when i press "enter" - excel will automatically mark the next column, for example - B:B and will go to the "table name" area, then ill put the name and press "enter" again and everything keeps going, until i decide to just stop the macro
The code assumes you already have tables and just have to rename them, that is what I understood form your question. If not, Why are you creating a table for columns which are next to each other? that is poor design and can lead to confusion. I always have at least one empty column between two tables.