Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
G'day there One & All,
Here I am back again, with another problem. This time while trying to sort with a custom list. Here's the code I'm trying to use: Private Sub oBtnRank_Click() If oBtnRank Then gRng.Sort _ key1:=Range("Rank"), _ order1:=srtDir, _ header:=xlYes, _ ordercustom:=cstmSrtRngCnt gStr = "Rank" End Sub This is the code from one of the OptionButtons on my userform. Except for the "ordercustom" part, the code is exactly the same as for 3 other optionbuttons, but they sort my range alphabetically (which is what they're supposed to do). This particular option is supposed to sort via my custom list, but for some reason it insists on sorting alphabetically and ignoring my custom list. To explain a little; gRng has been "set" to a named dynamic range. Range("Rank") is the heading for the third column in this range. "srtDir" is a string which has been set to Ascending or Descending. "cstmSrtRngCnt" is a numeric variable containing the count of custom lists - it's determined by If Not dSht.Range("wrkRanks").Cells.Count = 0 Then Application.AddCustomList (dSht.Range("wrkRanks")) End If cstmSrtRngCnt = Application.CustomListCount this is from the "Auto_Open" procedure. My best friend Google has provided me with one or two examples, but not a lot that seems applicable. There are heaps of descriptions of how to use custom lists directly from the sheet, but I've not found a lot that demonstrates how to do it in VB. If anyone can shed some light on this for me I'd be very grateful. Thanks very much for listening, -- Ken McLennan Qld, Australia |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
More help with Custom menu's 2 problems! | Excel Programming | |||
Excel sort by Fill Color by custom list sort | Excel Discussion (Misc queries) | |||
Custom cell format problems | Excel Discussion (Misc queries) | |||
Custom menu problems | Excel Programming | |||
Custom function problems | Excel Programming |