This is what I did .
On the
VB fourm they pick what column to sort on by a combo box
and the code to do the sort in excel is:
lnRow = last row in the spread sheet
l
cStartRow = the row the reports data start on since I have a header on the spread sheet
Select Case Me.cmbReportType.ListIndex
Case Is = 0
Select Case Me.cmbSortOn.ListIndex
Case Is = 0
lcCellToSortOn = "A"
Case Is = 1
lcCellToSortOn = "B"
Case Is = 2
lcCellToSortOn = "C"
Case Is = 3
lcCellToSortOn = "D"
Case Is = 4
lcCellToSortOn = "E"
Case Is = 5
lcCellToSortOn = "F"
End Select
lcStartRow = CStr(lnStartRow + 1)
lcCellToSortOn = lcCellToSortOn & lcStartRow
lcCellSelect = "A" & lcStartRow & ":F" & CStr(lnRow)
With goExcel
.Range(lcCellSelect).Sort .Range(lcCellToSortOn)
End With
End Select