I am trying to create several tables one in every sheet which loops through with a rep.
The creation of the tables works and the naming of each table created also works.
What I cannot seem to get to work is adress that created table and to sort the tables xlDescending on the first column of that table.
Here is my code so far. Without the sorting included. Thanks for any advice so far!
D.
Sub TabelleEinzeln()
For rep = 5 To 9
Dim SortOrder As Integer
Dim sheet_name As String
sheet_name = Sheets("Admin").Range("H" & rep).Value
table_name = Sheets("Admin").Range("I" & rep).Value
Sheets(sheet_name).Select
ActiveSheet.ListObjects.Add(xlSrcRange, Range("$A$8:$K$2276"), , xlYes).Name = _
table_name
'Here is where I would like to select ListObjects(table_name).sort..... etc. But it gives me an out of boundry error.
Next rep
MsgBox ("Sorted")
End Sub