Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I want to automatically sort my sheets out in a workbook,
eg sheet 1 is named "Msowdon - 101/1" - the first entry sheet 2 "Msowdon - 101/4" - the fourth entry sheet 3 "msowdon - 101/10" - the tenth entry sheet 4 "Msowdon - 101/12" - the twelth entry if i add a new sheet for the 11th job in this area the sheet will be called "Msowdon - 101/11" and should come after 101/10 and before 101/12, but after 101/4. The reference 101/11 is found from an entry on the sheet, and i can get excel to check the sheet reference and sort the sheets back in to order. My problem is this... Can I get excel to sort out in respect to the second number, so 101/4 will come before 101/11? I have tried changing the cells catagory in the format section, and it's not possible to have a zero in front of the 4 ie 101/04 as it is part of a much larger system. if anyone has encountered this, or has any solutions i would be eternally grateful. TIA Jon |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Not using built in sorting or comparison.
"101/10" is < "101/4" ? "101/10" < "101/4" True So you would have to sort by name, then for sheets with the same area, break out the numbers after the / and re sort just the area based on that. Or you could write similar type logic for the basic sort. -- Regards, Tom Ogilvy "jon" wrote in message ... I want to automatically sort my sheets out in a workbook, eg sheet 1 is named "Msowdon - 101/1" - the first entry sheet 2 "Msowdon - 101/4" - the fourth entry sheet 3 "msowdon - 101/10" - the tenth entry sheet 4 "Msowdon - 101/12" - the twelth entry if i add a new sheet for the 11th job in this area the sheet will be called "Msowdon - 101/11" and should come after 101/10 and before 101/12, but after 101/4. The reference 101/11 is found from an entry on the sheet, and i can get excel to check the sheet reference and sort the sheets back in to order. My problem is this... Can I get excel to sort out in respect to the second number, so 101/4 will come before 101/11? I have tried changing the cells catagory in the format section, and it's not possible to have a zero in front of the 4 ie 101/04 as it is part of a much larger system. if anyone has encountered this, or has any solutions i would be eternally grateful. TIA Jon |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
jon wrote:
I want to automatically sort my sheets out in a workbook, eg sheet 1 is named "Msowdon - 101/1" - the first entry sheet 2 "Msowdon - 101/4" - the fourth entry sheet 3 "msowdon - 101/10" - the tenth entry sheet 4 "Msowdon - 101/12" - the twelth entry if i add a new sheet for the 11th job in this area the sheet will be called "Msowdon - 101/11" and should come after 101/10 and before 101/12, but after 101/4. The reference 101/11 is found from an entry on the sheet, and i can get excel to check the sheet reference and sort the sheets back in to order. My problem is this... Can I get excel to sort out in respect to the second number, so 101/4 will come before 101/11? I have tried changing the cells catagory in the format section, and it's not possible to have a zero in front of the 4 ie 101/04 as it is part of a much larger system. if anyone has encountered this, or has any solutions i would be eternally grateful. TIA Jon Read this: http://www.cpearson.com/excel/sortws.htm You will have to change the lines that read: If UCase(Worksheets(N).Name) UCase(Worksheets(M).Name) Then to something like this: If val(mid(Worksheets(N).Name,4)) val(mid(Worksheets(M).Name,4) Then The mid(...,4) is assuming the first part is always 4 chars long: "101/" And the val(...) is assuming you are always using numbers in the second part. -- Amedee Van Gasse To top-post is human, to bottom-post and snip is sublime. Dit bericht is geplaatst in een nieuwsgroep. Post je evt antwoord of vervolgvraag graag in dezelfde thread in de nieuwsgroep a.u.b. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
excel sheet bootom half sheet goes behind top part of sheet | Excel Worksheet Functions | |||
Duplicate sheet, autonumber sheet, record data on another sheet | Excel Worksheet Functions | |||
How do I select price from sheet.b where sheet.a part no = sheet.b | Excel Worksheet Functions | |||
relative sheet references ala sheet(-1)!B11 so I can copy a sheet. | Excel Discussion (Misc queries) | |||
Inserting a row in sheet A should Insert a row in sheet B, removing a row in Sheet A should remove the corresponding row in sheet B | Excel Programming |