Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the following code. For some reason Key2 is not being sorted the way
I need it. For my santity, I tried switching between ascending/descending in key2 and both results same. Any ideas why? The sort range is columns A:AJ. Column B contains numbers and Column D contains dates. Private Sub Workbook_BeforeClose(Cancel As Boolean) 'sort contract workbook (Sheet1) only if Settlement4b.xls is not open Dim Wsheet As Worksheet Set Wsheet = Worksheets("Sheet1") 'Contracts workbook If Not WorkbookOpen("Settlement4b.xls") Then With Wsheet .Select .Range("A1").Sort _ Key1:=.Range("B1"), Order1:=xlAscending, Header:=xlYes, _ Key2:=.Range("D1"), Order1:=xlDescending, Header:=xlYes End With End If As aways Thanks! Mike End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBA Sort method w/more than 3 Keys | Excel Discussion (Misc queries) | |||
Sort Method Questions | Excel Programming | |||
To sort data in VBA/excel by the method of the minimas | Excel Programming | |||
sort method frustration | Excel Programming | |||
Sort method of range | Excel Programming |