I'm new to VBA and was hoping I could get some guidance on sorting and ordering.
I have a table of information with about 200 rows and 5 columns. In Column B there is "additional information" and I'm looking to identify which rows have text that contains in part any of the following words: "Training", "Admin", "General" and "Extra Info" and group them together.
So an example would be: Personal Admin, Work Admin, Weight Training, DD Extra Info, Training for EAS, General Write Ups.
So I need to be able to sort and order the whole row based only on part of each cell's value.
Hope that makes sense - I'd really appreciate any guidance!
I've used this custom list in the past to find and sort exact phrases:
Dim nCustomSort As Variant Dim xx As Long nCustomSort = Array("Training", "Admin", "General", "Extra Info") Application.AddCustomList ListArray:=nCustomSort With Worksheets("Sheet1") .Sort.SortFields.Clear xx = .Cells(Rows.Count, "B").End(xlUp).Row With .Range("A1:Z1000" & xx) .Cells.Sort Key1:=.Columns(2), Order1:=xlAscending, _ Orientation:=xlTopToBottom, Header:=xlYes, MatchCase:=False, _ OrderCustom:=Application.CustomListCount + 1 End With .Sort.SortFields.Clear End With