Currently this works, but I need the SortOnCellColor to be by RGB(255,199,206).
$range2 = $ExcelWorkSheet.range("D2")
$range3 = $ExcelWorkSheet.range("E2")
#two-column sort
$ExcelWorkSheet.sort.sortFields.clear()
[void]$ExcelWorkSheet.sort.sortFields.add($range2, $xlSortOnCellColor, $xlAscending,2,1)
[void]$ExcelWorkSheet.sort.sortFields.add($range3, $xlSortOnValues, $xlAscending,`
$xlSortNormal)
$ExcelWorkSheet.sort.setRange($range1)
$ExcelWorkSheet.sort.header = $xlYes
$ExcelWorkSheet.sort.orientation = $xlTopToBottom
$ExcelWorkSheet.sort.apply()
This is how you do it in VBA:
ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Add(Range("B1:B25"), _
xlSortOnFontColor, xlAscending, , xlSortNormal).SortOnValue.Color = RGB(255,199,206)