Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Macro for sorting a worksheet

I've looked everywhere. Is there a macro that someone has that can sort a
work sheet by one colum "P" where if it is blank all the blanks are at the
bottom and the filled in cells are at the top. Thanks

Ralph

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200702/1

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default Macro for sorting a worksheet

Sub Macro1()
Range("P1:R10").Sort Key1:=Range("P1"), Order1:=xlAscending, _
Header:=xlGuess, OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom, DataOption1:=xlSortNormal
End Sub

Change range to suit. It put the blanks at the bottom for me.

Hth,
Merjet

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Macro for sorting a worksheet

That Excel sorts in this order:
numbers
text
blanks (sort to the bottom)
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"ralphdevlin via OfficeKB.com"
<u11047@uwe
wrote in message
I've looked everywhere. Is there a macro that someone has that can sort a
work sheet by one colum "P" where if it is blank all the blanks are at the
bottom and the filled in cells are at the top. Thanks

Ralph

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Macro for sorting a worksheet

Thanks that worked, what I would like to do is adda Worksheet change even to
run the macro when the worksheet is saved so I don't have to run it
automatically. Thanks

Ralph

merjet wrote:
Sub Macro1()
Range("P1:R10").Sort Key1:=Range("P1"), Order1:=xlAscending, _
Header:=xlGuess, OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom, DataOption1:=xlSortNormal
End Sub

Change range to suit. It put the blanks at the bottom for me.

Hth,
Merjet


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200702/1

Reply
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 a Worksheet Bishop Excel Worksheet Functions 1 March 24th 09 01:29 PM
Sorting Master Worksheet to Regional Worksheet teapot10 Excel Worksheet Functions 3 April 14th 08 07:08 PM
Sorting a range on another worksheet without selecting the worksheet [email protected] Excel Programming 1 December 21st 06 11:06 PM
Sorting - Macro or worksheet function Danny Excel Worksheet Functions 1 August 2nd 05 09:17 PM
worksheet sorting sisco98 Excel Worksheet Functions 5 July 22nd 05 02:44 PM


All times are GMT +1. The time now is 03:52 AM.

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

About Us

"It's about Microsoft Excel"