Sorting of data

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
To use - right click sheet tab>view 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
(e-mail address removed)
Arne Harder Bang said:
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:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top