sal21
02-07-2008, 09:59 AM
Is possible to order line in sheet based 2 key, color in column AF and value in column AE????
i use in standard mode:
Sub ORDINA_REGIONI()
Dim WS As Worksheet
Dim ULTIMA As Long
Dim MIO_RANGE As RANGE
Set WS = Worksheets("STAT_NEW_1")
With WS
.Unprotect PASSWORD:="SAL21"
ULTIMA = Sheets("STAT_NEW_1").RANGE("AF" & Rows.Count).End(xlUp).Row
Set MIO_RANGE = Sheets("STAT_NEW_1").RANGE("A5:AF" & ULTIMA)
MIO_RANGE.Sort Key1:=RANGE("AF5"), Order1:=xlAscending, Key2:=RANGE("A5") _
, Order2:=xlAscending, Header:=xlNo, OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
.Protect PASSWORD:="SAL21"
End With
End Sub
i use in standard mode:
Sub ORDINA_REGIONI()
Dim WS As Worksheet
Dim ULTIMA As Long
Dim MIO_RANGE As RANGE
Set WS = Worksheets("STAT_NEW_1")
With WS
.Unprotect PASSWORD:="SAL21"
ULTIMA = Sheets("STAT_NEW_1").RANGE("AF" & Rows.Count).End(xlUp).Row
Set MIO_RANGE = Sheets("STAT_NEW_1").RANGE("A5:AF" & ULTIMA)
MIO_RANGE.Sort Key1:=RANGE("AF5"), Order1:=xlAscending, Key2:=RANGE("A5") _
, Order2:=xlAscending, Header:=xlNo, OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
.Protect PASSWORD:="SAL21"
End With
End Sub