View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Luke M Luke M is offline
external usenet poster
 
Posts: 2,722
Default Use macro to sort column

Macro to sorts B6:D18 by column D:

Sub SortByColumnD()
'Change first range as needed
'Do not change Key1
Range("B6:D18").Sort Key1:=Range("D1"), _
Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom, _
DataOption1:=xlSortTextAsNumbers
End Sub
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Paula" wrote:

I have 3 columns of info-B,C,D.
I want to sort the numbers in D in ascending order, but I need the info in B
and C to stay with the number in D.
I do not want to do it through "sort" because 5 worksheets has 77 rows, and
the sorting is in sections in those 77 rows. If you can show me the macro for
the first section, Rows 6-18, I can figure out the rest. Please do not leave
anything out of the macro, like the beginning and the end words, because I
cannot write them, I can only edit the ranges.
Thank You!
Paula