Custom Sort

G

Guest

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.
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top