Hi Matjaž
I noticed this is a recorded macro and these macros should be rewritten.
Please avoid using SELECT, SELECTION, or ACTIVECELL, it is slow and error-prone.
Always refer to the objects directly.
To further help you:
I would suggest the macro to be rewritten in the following order
First: Insert all the 15 Table Headers
Then: Convert the range to a Table and Rename it
The following macro will do it:
Sub CreateRefundTable()
'
' Keyboard Shortcut: Ctrl+Shift+A
With ActiveSheet
With Rows("1:1")
.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
'''' Insert all the table Headers
.Range("A1").Value = "SPOT"
.Range("B1").Value = "ZZZS številka obracuna"
.Range("C1").Value = "ZZZS številka zavarovanca:"
.Range("D1").Value = "Priimek in ime:"
.Range("E1").Value = "Številka ePotrdila:"
.Range("F1").Value = "Šifra razloga zadržanosti:"
.Range("G1").Value = "Prvi dan zadržanosti:"
.Range("H1").Value = "Datum zadržanosti"
.Range("I1").Value = "Datum zadržanosti do"
.Range("J1").Value = "Znesek obracuna zavezanca:"
.Range("K1").Value = "Znesek obracuna ZZZS:"
.Range("L1").Value = "Status obracuna:"
.Range("M1").Value = 1
.Range("N1").Value = 2
.Range("O1").Value = 3
''' Create the Table and Name it.
.ListObjects.Add(xlSrcRange, Range("$A$1:$O$13051"), , xlYes).Name = "Refund"
End With
End Sub
Note:
> You may easily change the order of the table headers according to your needs.
> Please, notice that we changed Range("$A$1:$D$13051") to Range("$A$1:$O$13051") as we have 15 columns range A to O.
Your table will look like this one

I hope this helps you and gives a solution to your problem
Do let me know if you need more help
Regards
Jeovany