I have a macro that when the file opens only works the first time, I am told that I need to set variables. Can anyone explain or show me what I need to do please.
Sub Macro1()
Application.EnableEvents = False
Application.DisplayAlerts = False
Application.ScreenUpdating = False
If Range("ap1").Value = "X" Then Exit Sub
Sheets("Sheet1").Select
Workbooks.Open Filename:="\\Ame-win2k\DriveE\MAL DATA\Projects\4 Database\Contract_DB_V1.1.xlsm" _
, UpdateLinks:=0, ReadOnly:=True
Sheets("Main").Select
Range("c8:Q2000").Select
Selection.Copy
Windows("Packing_Note_V1.1_12_Mar_2013.xlsm").Activate
Sheets("Sheet1").Select
Range("A8").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Range("table").Select
Selection.Sort Key1:=Range("a8"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Windows("Contract_DB_V1.1.xlsm").Activate
ActiveWorkbook.Close savechanges:=False
Windows("Packing_Note_V1.1_12_Mar_2013.xlsm").Activate
Sheets("Site Label").Select
Range("a20").Select
Macro8
End Sub
Bookmarks