#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Custom Sort

I've just written a very simple VBA program to help keep track of my
inventory, however I've run into a problem in sorting the items once they
have been entered into the inventory. I want to sort the items in the
inventory by part number, beginning by the first number and then by the
second digit, followed be the third, i.e. 1098, 20811, 2173, 29805, 311,
4908765 and so on, but I can't figure out how to do this and to stop it
sorting like this 311, 1098, 2173, 20811, 29805, 4908765. I've tried
creating a custom sort list as a macro then copying into my main program but
I always seem to end up with the same result. How can I make it list by first
digits, then second etc instead of by it's value. Any suggestions.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default Custom Sort

If you treat the field as text, it will sort alphabetically. Add a ' in front
of each number. When you sort it will ask to sort as a number or as text.

"Steve Stanley" wrote:

I've just written a very simple VBA program to help keep track of my
inventory, however I've run into a problem in sorting the items once they
have been entered into the inventory. I want to sort the items in the
inventory by part number, beginning by the first number and then by the
second digit, followed be the third, i.e. 1098, 20811, 2173, 29805, 311,
4908765 and so on, but I can't figure out how to do this and to stop it
sorting like this 311, 1098, 2173, 20811, 29805, 4908765. I've tried
creating a custom sort list as a macro then copying into my main program but
I always seem to end up with the same result. How can I make it list by first
digits, then second etc instead of by it's value. Any suggestions.

Reply
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
custom lists and custom formulas? nameruc Excel Discussion (Misc queries) 0 December 6th 06 04:18 PM
Using custom functions within custom validation Neil Excel Discussion (Misc queries) 4 December 14th 05 10:40 PM
Can you link a custom property to an Excel custom header text? LouErc Setting up and Configuration of Excel 0 November 8th 05 04:58 PM
custom list does not sort gitttep Excel Worksheet Functions 4 August 10th 05 03:22 PM
Excel sort by Fill Color by custom list sort Dash4Cash Excel Discussion (Misc queries) 2 July 29th 05 10:45 PM


All times are GMT +1. The time now is 06:51 AM.

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

About Us

"It's about Microsoft Excel"