Results 1 to 6 of 6

Ending Macros

Threaded View

  1. #1
    Registered User
    Join Date
    09-29-2008
    Location
    USA
    Posts
    16

    Ending Macros

    I have a macro that continues to tell me that an End With and/or End Sub is expected. I continue to add these statements in various ways, but the macro will not complete properly.

    Here is the code:

    Sub TestDatabase()
    '
    ' TestDatabase Macro
    ' Macro recorded 11/12/2008 by JLZ
    '
    ' Keyboard Shortcut: Ctrl+t
    '
    With Windows("file 1.xls")
        Range("E2").Copy
        Windows("file 2.xls").Range("B3").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
    With Windows("file 1.xls")
        Range("E3").Copy
        Windows("file 2.xls").Range("C3").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
    Windows("file 2.xls").Activate
        Rows("3:3").Select
        Application.CutCopyMode = False
        Selection.Insert Shift:=xlDown
    Windows("file 1.xls").Activate
        Range("C9").Select
    
    End With
    
    End Sub
    What is the proper order / format for these statements?
    Last edited by lj123; 11-21-2008 at 12:36 AM.

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