LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 90
Default Custom Sort Problems

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
More help with Custom menu's 2 problems! Karoo News Excel Programming 2 August 20th 05 03:24 PM
Excel sort by Fill Color by custom list sort Dash4Cash Excel Discussion (Misc queries) 2 July 29th 05 10:45 PM
Custom cell format problems Adam Excel Discussion (Misc queries) 1 June 29th 05 05:50 AM
Custom menu problems Andrew Fletcher Excel Programming 5 April 3rd 05 01:42 PM
Custom function problems Andrew B[_2_] Excel Programming 0 June 17th 04 05:20 AM


All times are GMT +1. The time now is 07:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"