Hello,
I am wondering if there is a way to use Excel's custom sort option without specifying a range. As of now the record macro gives me this:
ActiveWorkbook.Worksheets("pivot table current").Sort.SortFields.Add Key:= _
Range("A58:X58"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption _
:=xlSortNormal
This does what I want it to do, however the Range will not necessarily be the same every time this macro needs to run, so specifying a range here is not what I want.
If need to know: I am custom sorting last row from left to right and expanding selection to affect rest of data.
Thank you for your time in advance!
~JR
I am wondering if there is a way to use Excel's custom sort option without specifying a range. As of now the record macro gives me this:
ActiveWorkbook.Worksheets("pivot table current").Sort.SortFields.Add Key:= _
Range("A58:X58"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption _
:=xlSortNormal
This does what I want it to do, however the Range will not necessarily be the same every time this macro needs to run, so specifying a range here is not what I want.
If need to know: I am custom sorting last row from left to right and expanding selection to affect rest of data.
Thank you for your time in advance!
~JR