Basically I have the need to search for specific text (ex. cpu) in a text string of one column (D). I am using Excel 2011 on a mac. I think I can use VLOOKUP, but am not sure. Also I need to search for multiple text. For example I need to filter on cpu:
A B C D
ID User Component Description
C123 Jeff cpu The cpu is broken
C235 Kim mem memory is not working
C345 Bob kernel The cpu is damaged
Currently I am able to use an auto filter to sort the column C on cpu but I also need to sort column D on cpu and the autofilter is not working. I figure autofilter only works on one word. I need all of the rows that have "cpu" or whatever other text value that I need to only be displayed.
Range("$C$1:$C$5000").AutoFilter Field:=1, Criteria1:=Array( _
"cpu", "crash", "Segmentation-fault"), Operator:= _
xlFilterValues
What I need to do is sort the row that has the specific text such as cpu. Right now I have a macro reading the data from one file and sorting it in another. I just can't figure out how to search Column D for the same text ex. cpu.
Sub BugSort()
Workbooks.OpenText Filename:="report.xlsx"
Range("A1:I500").Select
Selection.Copy
Workbooks.Open "Bug-Sort.xlsx"
ActiveWorkbook.Sheets.Add
Range("A1").Formula = "Availability"
Range("A3").Select
ActiveSheet.Paste
Range("$C$1:$C$5000").AutoFilter Field:=1, Criteria1:=Array( _
"crash", "Segmentation-fault", "High-cpu", _
"coredump", "'shell-execution-failed", "switchover"), Operator:= _
xlFilterValues
Columns("A:I").Select
ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Add Key:=Range("C2:C3000") _
, SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Sheet1").Sort
.SetRange Range("A1:H5000") 'may want to code this so it scopes to diff rows and columns
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub
A B C D
ID User Component Description
C123 Jeff cpu The cpu is broken
C235 Kim mem memory is not working
C345 Bob kernel The cpu is damaged
Currently I am able to use an auto filter to sort the column C on cpu but I also need to sort column D on cpu and the autofilter is not working. I figure autofilter only works on one word. I need all of the rows that have "cpu" or whatever other text value that I need to only be displayed.
Range("$C$1:$C$5000").AutoFilter Field:=1, Criteria1:=Array( _
"cpu", "crash", "Segmentation-fault"), Operator:= _
xlFilterValues
What I need to do is sort the row that has the specific text such as cpu. Right now I have a macro reading the data from one file and sorting it in another. I just can't figure out how to search Column D for the same text ex. cpu.
Sub BugSort()
Workbooks.OpenText Filename:="report.xlsx"
Range("A1:I500").Select
Selection.Copy
Workbooks.Open "Bug-Sort.xlsx"
ActiveWorkbook.Sheets.Add
Range("A1").Formula = "Availability"
Range("A3").Select
ActiveSheet.Paste
Range("$C$1:$C$5000").AutoFilter Field:=1, Criteria1:=Array( _
"crash", "Segmentation-fault", "High-cpu", _
"coredump", "'shell-execution-failed", "switchover"), Operator:= _
xlFilterValues
Columns("A:I").Select
ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Add Key:=Range("C2:C3000") _
, SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Sheet1").Sort
.SetRange Range("A1:H5000") 'may want to code this so it scopes to diff rows and columns
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub