newbie1983
Programmer
I have recorded a macro which sorts a particular coloumn, but i want a universal macro such that when i openup a workbook/worksheet itll sort coloumn D.
Kind Regards
Hinesh
Kind Regards
Hinesh
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Sub fOpen()
Dim fName As String
fName = Application _
.GetOpenFilename("Excel Files (*.xls), *.xls")
If fName = "" Then
Exit Sub
End If
Workbooks.Open (fName)
Application.Run "fSort"
End Sub
Private Sub fSort()
ActiveSheet.Range("D1").Sort key1:=Range("D1"), order1:=xlDescending
End Sub
[\code]
Dan.