Hello all
I created a button with excel and assigned a macro to it which I recorded with excel Macro Record..
The button sorts column C ascending, this is the code
[CODE=vb]Sub Macro1()
Range("C7:C11") .Select
Selection.Sort Key1:=Range("C7 "), Order1:=xlAscen ding, Header:=xlGuess ,
OrderCustom:=1, MatchCase:=Fals e, Orientation:=xl TopToBottom, _
DataOption1:=xl SortNormal
Range("D9").Sel ect
End Sub[/CODE]
I want to make this macro sorts Descending when I click on the button again ..
and the Ascending with another click and so on ..
If anyone knows how to do it .. please write the code ..
thanks
I created a button with excel and assigned a macro to it which I recorded with excel Macro Record..
The button sorts column C ascending, this is the code
[CODE=vb]Sub Macro1()
Range("C7:C11") .Select
Selection.Sort Key1:=Range("C7 "), Order1:=xlAscen ding, Header:=xlGuess ,
OrderCustom:=1, MatchCase:=Fals e, Orientation:=xl TopToBottom, _
DataOption1:=xl SortNormal
Range("D9").Sel ect
End Sub[/CODE]
I want to make this macro sorts Descending when I click on the button again ..
and the Ascending with another click and so on ..
If anyone knows how to do it .. please write the code ..
thanks
Comment