Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 01-21-2017, 12:58 AM
trevorc trevorc is offline sort dynamic table name with vba Windows 7 32bit sort dynamic table name with vba Office 2013
Competent Performer
sort dynamic table name with vba
 
Join Date: Jan 2017
Posts: 173
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
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
sort dynamic table name with vba Dynamic table numbers srinidhi.mv88 Word VBA 5 06-22-2015 06:35 AM
Dynamic Mail Merged Table hanskimber Mail Merge 2 04-24-2015 11:21 PM
VBA sort table code mikec Excel Programming 8 10-01-2013 04:37 PM
Sort table using macro saslotteroy Word VBA 2 09-15-2011 02:41 PM
sort dynamic table name with vba How to sort table having three columns? Bahir Barak Word 2 01-20-2011 01:52 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:30 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft