ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Sorting of data (https://www.excelbanter.com/excel-programming/299959-sorting-data.html)

Arne Harder Bang

Sorting of data
 
I have a spreadsheet containing musicdata. I want to make a sort, depending on a validated column. Some times it's the artist (a=artist) and some times it's the titel ex

Various artist; Barrelhouse piano should be sorted after tite

Davis, Miles; Working with Miles Davis Quientet should be sorted after artist

Validation (A or T) is column
Artist is column
Titel is column D

Don Guillett[_4_]

Sorting of data
 
To use - right click sheet tabview code copy/paste this

Here is a doubleclick event I use to sort by the active column if double
click row 4.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If Target.Row = 4 Then
Range("a5:g" & Range("a65536").End(xlUp).Row) _
..Sort Key1:=Cells(5, ActiveCell.Column), Order1:=xlAscending,
Orientation:=xlTopToBottom
Cells(5, Target.Column).Select
End If
'end sub

'below plays the song if double click below row 4
mc = Cells(ActiveCell.Row, "e")
If Target.Row 4 Then
x = Right(Application.OperatingSystem, 4)
If x < 5 Then
cmd = "Start " & Chr(34) & mc & Chr(34)
Shell cmd 'works with xl97
Else
Dim FullFileName As String
'FullFileName = Selection.Offset(0, mc)
FullFileName = mc
ActiveWorkbook.FollowHyperlink Address:=FullFileName
End If
End If
End Sub

--
Don Guillett
SalesAid Software

"Arne Harder Bang" wrote in message
...
I have a spreadsheet containing musicdata. I want to make a sort,

depending on a validated column. Some times it's the artist (a=artist) and
some times it's the titel ex:

Various artist; Barrelhouse piano should be sorted after titel

Davis, Miles; Working with Miles Davis Quientet should be sorted after

artist.

Validation (A or T) is column B
Artist is column C
Titel is column D





All times are GMT +1. The time now is 12:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com