Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I'm using this for a sort routine :- Sub SortCol(strSheetName As String, strColumnLetter As String, strSortOrder As String) Dim rngCurrentCell As Range Dim rngNextCell As Range Dim strColumnRange strColumnRange = "A1:M" & mCt strColumnLetter = strColumnLetter & "1" If strSortOrder = "D" Then Worksheets(strSheetName).Range(strColumnRange).Sor t _ Key1:=Worksheets(strSheetName).Range(strColumnLett er), Order1:=xlDescending Else Worksheets(strSheetName).Range(strColumnRange).Sor t _ Key1:=Worksheets(strSheetName).Range(strColumnLett er), Order1:=xlAscending End If Set rngCurrentCell = Worksheets(strSheetName).Range(strColumnRange) End Sub ....and all is well. A nice refinement would be to know where the previously selecteted row was sorted to. (So I could re-select it). Apart from searching for it, is there any other way? Thanks - Kirk |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
hyperlinks change when sorting | Links and Linking in Excel | |||
SORTING WITHOUT CHANGE IN FORMAT | Excel Discussion (Misc queries) | |||
Hyperlinks change after sorting | Links and Linking in Excel | |||
Sorting problem, sums change | Excel Discussion (Misc queries) | |||
Change Key Mapping | Excel Programming |