Results 1 to 3 of 3

Setting variables

Threaded View

  1. #1
    Registered User
    Join Date
    03-22-2013
    Location
    sklmrsdale
    MS-Off Ver
    Excel 2010
    Posts
    7

    Setting variables

    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
    Last edited by clueless2; 03-23-2013 at 04:46 AM. Reason: new to this not sure were I should be putting tags

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1