Grade4.2
05-14-2018, 03:53 AM
Hello Everyone,
I'll be using excel 2007 to run this spreadsheet.
I have uploaded my workbook for reference.
In the data dump tab, I copy and paste the data you see from another spreadsheet.
When I run the macro to sort the green colors in descending order, I get an error because the ranges in macro "Sortv2" aren't dynamic. The beginning of my recorded macro and the ranges i'm referring to are as follows:
Sub Sortv2()
'
' Sortv2 Macro
'
'
Sheets("DataDump").Select
Range("A1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
ActiveWorkbook.Worksheets("DataDump").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("DataDump").Sort.SortFields.Add(Range("D2:89"), _
xlSortOnCellColor, xlDescending, , xlSortNormal).SortOnValue.Color = RGB(196, _
215, 155)
ActiveWorkbook.Worksheets("DataDump").Sort.SortFields.Add(Range("E2:E89"), _
xlSortOnCellColor, xlDescending, , xlSortNormal).SortOnValue.Color = RGB(196, _
I'll be using excel 2007 to run this spreadsheet.
I have uploaded my workbook for reference.
In the data dump tab, I copy and paste the data you see from another spreadsheet.
When I run the macro to sort the green colors in descending order, I get an error because the ranges in macro "Sortv2" aren't dynamic. The beginning of my recorded macro and the ranges i'm referring to are as follows:
Sub Sortv2()
'
' Sortv2 Macro
'
'
Sheets("DataDump").Select
Range("A1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
ActiveWorkbook.Worksheets("DataDump").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("DataDump").Sort.SortFields.Add(Range("D2:89"), _
xlSortOnCellColor, xlDescending, , xlSortNormal).SortOnValue.Color = RGB(196, _
215, 155)
ActiveWorkbook.Worksheets("DataDump").Sort.SortFields.Add(Range("E2:E89"), _
xlSortOnCellColor, xlDescending, , xlSortNormal).SortOnValue.Color = RGB(196, _