The following code replaces my original code. It makes a simple table with no row/header shading. Obviously you can adjust the table properties in the code itself. This code adds a Total row at the bottom; if you don't want that just delete or comment out that row. Also, it creates a table called 'Table1' every time it is run. If you want to be able to change that, you may want to either add an InputBox to get a name from the user, or loop through any current tables to see if a name is already used (code will error if it tries to create another table with the same name).
Sub makeTbl()
ActiveSheet.ListObjects.Add(xlSrcRange, Range(Selection.Address), , xlYes).Name = "Table1"
With ActiveSheet.ListObjects("Table1")
.ShowTableStyleRowStripes = False
.ShowHeaders = True
.TableStyle = "TableStyleLight21"
.ShowTotals = True
End With
End Sub
Bookmarks