Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Sort Macro Start On Row 7 Until Null


I trying to create a macro that will sort column K in descending order with
all of the other columns included, data starts on row 7 until row is empty
(null or "").

Lines 1-6 have header information.

Thanks so much for the help with this macro.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Sort Macro Start On Row 7 Until Null

You didn't specify which columns. fixt this statement in code below for
your range of columns

A = Startcolumn
M = End column
Set SortRange = Range("A7:M" & LastRow)



Sub Macro3()
'
' Macro3 Macro
' Macro recorded 10/9/2007 by Joel
'

'
LastRow = Cells(Rows.Count, "K").End(xlUp).Row
Set SortRange = Range("A7:M" & LastRow)
SortRange.Sort Key1:=Range("K7"), _
Order1:=xlAscending, _
Header:=xlGuess, _
MatchCase:=False, _
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End Sub


"Joe K." wrote:


I trying to create a macro that will sort column K in descending order with
all of the other columns included, data starts on row 7 until row is empty
(null or "").

Lines 1-6 have header information.

Thanks so much for the help with this macro.


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
Failed to save table attributes of (null) into (null). Luca Brasi Excel Discussion (Misc queries) 2 February 4th 09 04:30 PM
VB macro != NUll expression Daniel Excel Programming 2 June 13th 07 05:36 PM
Change macro to hide row if null [email protected] Excel Programming 2 February 8th 07 06:06 PM
Handling a Null Cell in Macro Ken Excel Programming 1 October 20th 04 01:51 AM
Handling Null Field in Macro Loop Ken Excel Programming 2 October 19th 04 10:17 PM


All times are GMT +1. The time now is 04:14 PM.

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"