I used the macro recorder to format a table.
The first part is allways the same (The SAP Output is weird, so I need to delete the 3 rows and first column)
But the last part A1:D5224 differs every time. I need a dynamic code to find the last cell and column and format a table. Thank you!
Code:
Sheets("M1").Activate
Rows("1:1").Select
Selection.Delete Shift:=xlUp
Columns("A:A").Select
Selection.Delete Shift:=xlToLeft
Rows("2:2").Select
Selection.Delete Shift:=xlUp
'this part should be dynamic - for rows and columns
Range("A1:D5224").Select
Range("B8").Activate
ActiveSheet.ListObjects.Add(xlSrcRange, Range("$A$1:$D$5224"), , xlYes).Name = _
"Tabelle3"
Range("Tabelle3[#All]").Select
The first part is allways the same (The SAP Output is weird, so I need to delete the 3 rows and first column)
But the last part A1:D5224 differs every time. I need a dynamic code to find the last cell and column and format a table. Thank you!