Reputation: 7687
New to excel vba, Sorry if this is too obvious...
I got this data in spreadsheet,
How can filter out the table by "title" column
So I will be able to select part of the table by filtered by title
thanks
book name Description title
gsod Samples from US weather since 1929 title1
mlab Measurement data of performance title1
natality Birth States from 1969 to 2008 title2
shakespeare Word index for works of title2
wikipedia Revision information for Wikipedia title1
Upvotes: 0
Views: 3879
Reputation: 158
A simple example to accomplish what you are trying to do is:
Sub SortColumnC()
If Sheets(1).AutoFilterMode = False Then
Sheets(1).Range("A1:C1").AutoFilter
End If
RowCount = Sheets(1).Range("A" & Rows.Count).End(xlUp).Row
ActiveWorkbook.Worksheets(1).AutoFilter.Sort.SortFields.Clear
ActiveWorkbook.Worksheets(1).AutoFilter.Sort.SortFields.Add Key:=Range("C2:C" & RowCount), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets(1).AutoFilter.Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub
Upvotes: 2