![]() |
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. |
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. |
All times are GMT +1. The time now is 02:44 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com