Hello
In a macro I add a custom sort list based on a list/range on (Page A), then I sort a list on Page A based on the custom list.
Finally it "worked" in that there were no more syntax errors, but it is sorting alphabetically, NOT in the order specified on the other page
????
1. So my first question is: what have I left out that it is reverting to alphabetic order? (I have checked, and the customlist is being created, and is in the order I want it)
2. Additionally, what I'd like to do, is sort it in the order on Page A, but leave a blank in the appropriate row on Page B if the list does not include something in the list on Page A.
-Hope that makes sense-
The relevant piece of code is below.
In a macro I add a custom sort list based on a list/range on (Page A), then I sort a list on Page A based on the custom list.
Finally it "worked" in that there were no more syntax errors, but it is sorting alphabetically, NOT in the order specified on the other page
????
1. So my first question is: what have I left out that it is reverting to alphabetic order? (I have checked, and the customlist is being created, and is in the order I want it)
2. Additionally, what I'd like to do, is sort it in the order on Page A, but leave a blank in the appropriate row on Page B if the list does not include something in the list on Page A.
-Hope that makes sense-
The relevant piece of code is below.
Code:
RelRange1 = relColS & relrow & ":" & relColS & 10
Application.AddCustomList Worksheets("2 All indicator names").Range(RelRange1)
iCustListNum = Application.CustomListCount
'
' sort using latest custom sort order entry
newrow = ActiveCell.Row
newCol = Chr(ActiveCell.Column + 64)
RelRange2 = newCol & newrow & ":" & newCol & (newrow + 9)
'
Range(RelRange2).Sort Key1:=Range(newCol & newrow), OrderCustom:=9, Header:=xlNo, MatchCase:=False
'
' remove latest custom sort entry order
Application.DeleteCustomList Application.CustomListCount