Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am working on a hospital project. Casenotes are stored by a 3 dual digit
system eg. 23 44 67 with casenotes ending in ** ** 68 and ** ** 66 stored adjacent. Get it? I have a load of notes to look up so I need to sort out the casenote numbers I have by the last two digits in order to simplify the manual search for the notes. Is there any way I could program the Excel list I have to sort the last two digits of the casenote numbers into numerical order? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Wallaby,
The following code assumes all your data is in one list and the case notes are in the first row, and all data is on sheet1 sub sort() nurec = sheet1.usedrange.rows.count for t = 1 to nurec for y = 1 to nurec casno = right(cells(y,1),2) casnonex = right(cells(y+1,1),2) if casnonex casno then goto nexty rows(trim(str(y))).copy rows(trim(str(nurec+6))).select activesheet.paste rows(trim(str(y+1))).copy rows(trim(str(y))).select activesheet.paste rows(trim(str(nurec+6))).copy rows(trim(str(y+1))).select activesheet.paste rows(trim(str(nurec+6))).clear nexty: next y next t end sub note this sub is completely untested and i may have misunderstood your criteria, run on a backup copy first "The Wallaby" wrote: I am working on a hospital project. Casenotes are stored by a 3 dual digit system eg. 23 44 67 with casenotes ending in ** ** 68 and ** ** 66 stored adjacent. Get it? I have a load of notes to look up so I need to sort out the casenote numbers I have by the last two digits in order to simplify the manual search for the notes. Is there any way I could program the Excel list I have to sort the last two digits of the casenote numbers into numerical order? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I sort a list of numbers by the last 4 digits? | Excel Worksheet Functions | |||
How can I sort a list of numbers by the last 4 digits? | Excel Discussion (Misc queries) | |||
sort by numbers of digits in cells | Excel Worksheet Functions | |||
Auto insert page breaks in Excel, based on a sort of numbers | Excel Discussion (Misc queries) | |||
sort numbers based on initial digit. | Excel Discussion (Misc queries) |