i figured it out......i changed the sort routine.....to this........
'*****************************************************************
'*****************************************************************
Sub sort_file_array(fl_macro As String, file_array1 As Variant)
Set ws_macro = Workbooks(fl_macro).Worksheets(misc_info_sht)
num_entries = UBound(file_array1, 2)
If UBound(file_array1, 2) > 0 Then
'we will use col E and F on the Misc_info_sheet of the macro to paste
'contents of the array .......sort in alphabetical order then read it
'back into the array
'paste array into col E
'ws_macro.Range("E1").Resize(UBound(file_array1, 2)).Value = WorksheetFunction.Transpose(file_array1)
'ws_macro.Range("E1").Resize(UBound(file_array1, 2)).Value = file_array1
'ws_macro.Range("E1").Resize(UBound(file_array1, 2)).Value = Application.Transpose(file_array1)
ws_macro.Range("E1:F" & num_entries).Value2 = Application.Transpose(file_array1)
'sort col k in alphabetical order......use col K from this sheet to help sort data
ws_macro.Range("E1:F" & num_entries).Sort _
Key1:=ws_macro.Columns(6), Order1:=xlAscending, _
Key2:=ws_macro.Columns(5), Order1:=xlAscending, _
Header:=xlNo
'store alphabetized list into array
file_array1 = ws_macro.Range("E1:F" & num_entries).Value2
file_array1 = Application.Transpose(file_array1)
MsgBox ("stope")
'clear contents only in col
ws_macro.Range("E:F").ClearContents
'ws_macro.Range("m1").Resize(UBound(file_array1, 1), 1).Value = file_array1
End If
End Sub
Bookmarks