LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 345
Default Macro for Special Sorting

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sorting special text and/or graphics Peter Excel Discussion (Misc queries) 0 September 2nd 09 02:51 PM
Special Copy, Paste Special macro usmc-r70 Excel Programming 3 July 2nd 09 08:12 AM
preparing pivot fields for copying and paste special for sorting rsmith333 Excel Discussion (Misc queries) 2 June 4th 07 01:21 PM
Please help with this special macro alvin Kuiper Excel Programming 2 April 22nd 06 06:23 PM
Special macro Dave Peterson[_3_] Excel Programming 2 September 7th 04 08:41 PM


All times are GMT +1. The time now is 09:37 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"