Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default sort problem

I am trying to sort by column "s" and the following code does nothing... but
doesn't have any VBA errors. I am in excel 2007

Range("A4:x4").Select
'Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
ActiveWorkbook.Worksheets("CALLMON").Sort.SortFiel ds.Clear
ActiveWorkbook.Worksheets("CALLMON").Sort.SortFiel ds.Add Key:=Range( _
"S4"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal


any ideas?????????
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default sort problem

see if this will work for you, i don't know which version of excel you're using.

Sub test()
With Worksheets("callmon").Range(Range("A4:Z4"), Range("A4:x4").End(xlDown))
.Sort Key1:=.Range("S4"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End With
End Sub

--


Gary


"John" wrote in message
...
I am trying to sort by column "s" and the following code does nothing... but
doesn't have any VBA errors. I am in excel 2007

Range("A4:x4").Select
'Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
ActiveWorkbook.Worksheets("CALLMON").Sort.SortFiel ds.Clear
ActiveWorkbook.Worksheets("CALLMON").Sort.SortFiel ds.Add Key:=Range( _
"S4"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal


any ideas?????????



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
Sort of a problem? Dean Excel Programming 3 April 24th 08 07:01 PM
Sort Problem Trish[_2_] Excel Discussion (Misc queries) 1 March 25th 08 12:51 PM
Big sort problem Patrick Simonds Excel Programming 0 December 18th 06 06:25 AM
A "sort" problem comotoman Excel Discussion (Misc queries) 1 September 28th 05 10:48 PM
Sort Problem jdb Excel Discussion (Misc queries) 1 January 11th 05 12:05 AM


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