Hello,

I have multiple large data audits that contain "style" numbers, that will change but can repeat as there is also a "size" value (not concerned with size values). I am looking to evaluate patterns of repeating "styles" by running some VBA against these workbooks on a weekly basis (when new reports generate) so I can quickly spot any trends where styles are repeating, which hints at issues with allocations, nonshipments, transfers etc. The column I am looking at is K, and reports will change in size, and row count every week.

Here is what I've been able to piece together so far, but the VBA I've found is applying based off of numeric value not cell value (this is what I get for googling this sort of thing).


' Sort data by Style (column K)
Cells.Select
ActiveWorkbook.ActiveSheet.Sort.SortFields.Clear
ActiveWorkbook.ActiveSheet.Sort.SortFields.Add Key:=Range("K:K" _
), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.ActiveSheet.Sort
.SetRange Range("A:At")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With


Dim color As String

For Each cell In ActiveSheet.Range("K:K")

If IsEmpty(cell) Then GoTo nextcell:
If Not IsNumeric(cell.Value) Then GoTo nextcell:

If cell.Value > 50 Then
color = 4
ElseIf cell.Value < 35 Then color = 3
Else: color = 2
End If
cell.EntireRow.Interior.ColorIndex = color
nextcell:
Next cell