Listview1 is the name of the listview control
Private Sub ListView1_ColumnClick(ByVal ColumnHeader As MSComctlLib.ColumnHeader)
With ListView1
If .SortKey <> ColumnHeader.Index - 1 Then
.SortKey = ColumnHeader.Index - 1
.SortOrder = lvwAscending
Else
If .SortOrder = lvwAscending Then
.SortOrder = lvwDescending
Else
.SortOrder = lvwAscending
End If
End If
.Sorted = -1
End With
End Sub
Visit my blog @ http://jaypeeee.blogspot.com/
with all the available answers i have found in the web, this is the one that is really helpful and effective.
ReplyDeletethank you very much! :D
thanks
Deleteit works flawlessly.. just copy to your project, voila.. ;) Best and the simplest answer in the web..
ReplyDeletethx a lot m8!!
wow... it works....!!!! it really works!!!! I'm so glad.. Thank you so much...
ReplyDeleteExcellent, thank you. So many complex versions elsewhere, good to find your nice concise version.
ReplyDeletevery usefull ... thank you ...
ReplyDeleteThanks Everyone.
ReplyDeleteGreat thank you
ReplyDeleteThanks sir
DeleteGreat thank you
ReplyDeleteThanks for article, very useful
ReplyDeleteThanks Sir
DeleteThank you dude!
ReplyDeleteIt helpful in 2016!
Thanks for saving my time
ReplyDeleteThanks
ReplyDeleteThat is a clever and elegant code solution
Very useful! Simple and effective. Thanks a lot!!
ReplyDelete