Hi,
I'm trying to sort my data so when you click the column header the data either goes Ascending or Descending. What I have below works (ish) but the data is currency and rather sorting it like this:
£1.23
£2.22
£3.44
£10.04
£24.11
£30.00
It only looks at the 1st number i.e:
£1.23
£10.04
£2.22
£24.11
£3.44
£30.00
The code I am using is below - any help would be appriciated.
Thanks
Michael
Private Sub lvwMain_ColumnClick(ByVal ColumnHeader As MSComctlLib.ColumnHeader)
If ColumnHeader.Text = "Remaining Balance" Then
Me.lvwMain.Sorted = True
Me.lvwMain.SortKey = 3
If Me.lvwMain.SortOrder = lvwAscending Then
Me.lvwMain.SortOrder = lvwDescending
Else
Me.lvwMain.SortOrder = lvwAscending
End If
Else
Me.lvwMain.Sorted = False
End If
End Sub
I'm trying to sort my data so when you click the column header the data either goes Ascending or Descending. What I have below works (ish) but the data is currency and rather sorting it like this:
£1.23
£2.22
£3.44
£10.04
£24.11
£30.00
It only looks at the 1st number i.e:
£1.23
£10.04
£2.22
£24.11
£3.44
£30.00
The code I am using is below - any help would be appriciated.
Thanks
Michael
Private Sub lvwMain_ColumnClick(ByVal ColumnHeader As MSComctlLib.ColumnHeader)
If ColumnHeader.Text = "Remaining Balance" Then
Me.lvwMain.Sorted = True
Me.lvwMain.SortKey = 3
If Me.lvwMain.SortOrder = lvwAscending Then
Me.lvwMain.SortOrder = lvwDescending
Else
Me.lvwMain.SortOrder = lvwAscending
End If
Else
Me.lvwMain.Sorted = False
End If
End Sub