LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default sort blank cells first instead of last

There have been a few solutions (mostly manual) posted for sorting a
database with blank cells in the chosen sort fields being sorted first
instead of last. I'm trying to come up with a more automated method
but am stumped on the first part of my method which involves a
UserForm.

Using Excel 2000, I'm trying to create a UserForm which as closely as
possible looks and acts like Excel's standard Sort dialog box and then
use that UserForm in place of the Sort dialog box whenever I want
blank cells sorted first instead of last.

Like the Sort dialog box, this UserForm would let you choose up to 3
fields and designate either Ascending or Descending for each and
perhaps even allow for indicating "Header Row" or "No Header Row".
(Duplicating all the options that come up when clicking the Options
button in the Sort dialog box would be "pushing the envelope" too
much, I'm sure.)

Code associated with this UserForm would do the following:
1. Trap whatever fields were chosen in that UserForm
2. Fill any blank cells within those fields with a very large (or
should I say very small) negative number (such as -9999999999) to
insure they get sorted first
3. Sort the database
4. Change the fields containing that -9999999999 number back to blank
again
5. Then lastly, unload the UserForm.

I'm kind of weak on this level of UserForm creation. Any help would
be greatly appreciated.

Many thanks,
Paul
 
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
sort a table that contains both numbers and blank cells slickedge52 Excel Discussion (Misc queries) 1 October 8th 09 06:13 PM
sort and blank cells problem Mrs T.[_2_] Excel Worksheet Functions 4 May 6th 09 08:27 PM
Sort when I have blank cells C. Corodan Excel Discussion (Misc queries) 1 August 6th 08 01:20 PM
sort and sum data range with some blank cells rldjda Excel Worksheet Functions 1 March 23rd 08 06:19 AM
Why arent my blank cells moved to the end when I do a sort? George New Users to Excel 3 May 31st 06 09:34 PM


All times are GMT +1. The time now is 11:02 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"