Hello gentlemen,
Thanks for the quick replies, but still unable to resolve problem. What I'm doing is adding a client to a list then clicking a button to sort the list save to backups dir in same path and then change to different sheet. The rows after dim Str and before .save seem to be the problem.
Thanks for all the help
Mjack59
Sub sortdatabase()
' sortdatabase and move to link sheet macro
' Macro recorded 4/5/2004 by Mark Jackson
With Application
.ScreenUpdating = False
.DisplayAlerts = False
.EnableEvents = False
Range("A3").Sort Key1:=Range("A3"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
With ThisWorkbook
Dim Str_TargetFile As String
.SaveCopyAs ThisWorkbook.Path & "\backup\" & _
Left(ThisWorkbook.Name, InStr(1, LCase(ThisWorkbook.Name), ".xlt") - 1) & _
" - " & Format(Now, "m-d-yy h_mm a/p") & ".xls"
.save
End With
Sheets("Link SpreadSheet").Select
Range("E1").Select
.DisplayAlerts = True
.EnableEvents = True
.ScreenUpdating = True
End With
End Sub