Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Z42,
I don't understand why you say the code would run a long time. I put the code into K's posting. I had a macro that was very similar and modified it. With about 500 rows of test data, it ran in under 3 seconds. I don't think that's a long time. All the best, N -- Neal Z "IdiotZ42" wrote: depending on the size of your spread sheet code to do this would run quite a long time. For the most efficent method that i know of try inserting a new column to the left of the two columns holding these file names. now using the new column set a range variable to be from the first row of data to the last row of data. then on that range set the .formula = "=IF(b2c2,b2,c2)" for ascending or "=IF(b2<c2,b2,c2)" for descending sort by the whole table by the new colum, and delete the column after the sort... FYI: excel 03's sort is non-stable, meaning if two rows have the same value they can endup in any order... "K" wrote: I have file names listed in column A and B like (see below) A B€¦€¦col Jim Boot - data.xls John Wood (Record List).xlsx Ali Khan (data).xlsm Dean Wild - system.xls Bob Will.xlsx Jim Boot (actuals).xlsm John Wood.xls Kam Finch.xlsx Ali Khan (Recorded data).xls The special thing about file names listed in column A and B is that the first two words in those are always the first name and last name of the person. I am looking for a macro which should sort both these columns lists alphabatically and also the way that same name should come in same row. so i am looking for the result something like (see below) A B€¦€¦col Ali Khan (data).xlsm Ali Khan (Recorded data).xls Bob Will.xlsx Dean Wild - system.xls Jim Boot - data.xls Jim Boot (actuals).xlsm John Wood.xls John Wood (Record List).xlsx Kam Finch.xlsx I'll be very thankful if any friend got sultion for this kind of sorting. . |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sorting special text and/or graphics | Excel Discussion (Misc queries) | |||
Special Copy, Paste Special macro | Excel Programming | |||
preparing pivot fields for copying and paste special for sorting | Excel Discussion (Misc queries) | |||
Please help with this special macro | Excel Programming | |||
Special macro | Excel Programming |