View Single Post
 
Old 01-21-2017, 12:58 AM
trevorc trevorc is offline Windows 7 32bit Office 2013
Competent Performer
 
Join Date: Jan 2017
Posts: 174
trevorc will become famous soon enoughtrevorc will become famous soon enough
Default neer mind I found the solution

So it was syntax, just had to figure out how to get it in there... See below if you also need this.

Code:
                tbl_name = "Table" & foundNum & "[[#All],[Sheet & Location]]"
                tbl1_name = "Table" & foundNum
                ActiveSheet.ListObjects.Add(xlSrcRange, Range(tbl_start & ":$AA$" & row18), , xlYes).Name = "Table" & foundNum
                ActiveWorkbook.Worksheets("Instructions").ListObjects(tbl1_name).Sort.SortFields.Clear
                ActiveWorkbook.Worksheets("Instructions").ListObjects(tbl1_name).Sort.SortFields _
                .Add Key:=Range(tbl_name), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
                With ActiveWorkbook.Worksheets("Instructions").ListObjects(tbl1_name).Sort
                    .Header = xlYes
                    .MatchCase = False
                    .Orientation = xlTopToBottom
                    .SortMethod = xlPinYin
                    .Apply
                End With
Reply With Quote