+ Reply to Thread
Results 1 to 2 of 2

Simplify Copy and Paste

Hybrid View

Stekke80 Simplify Copy and Paste 12-25-2006, 05:35 PM
VBA Noob Hi, This might help.... 12-25-2006, 06:13 PM
  1. #1
    Registered User
    Join Date
    12-25-2006
    Posts
    2

    Arrow Simplify Copy and Paste

    How could i simplify this macro?


    Range("P389").Select
    Windows("dagrapport-week-52.xls").Activate
    Range("E6").Select
    Selection.Copy
    Windows("afrekening december2006.xls").Activate
    ActiveSheet.Paste
    Range("P390").Select
    Windows("dagrapport-week-52.xls").Activate
    Range("F6").Select
    Selection.Copy
    Windows("afrekening december2006.xls").Activate
    ActiveSheet.Paste


    Thanks in Advance,

    Kindly regards

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    This might help. Assumes you run the code while in the workbook
    dagrapport-week-52.xls

    Sub Copy()
    
    Range("P389:P390").Copy
    Workbooks("afrekening december2006.xls").Activate
    Range("E6:F6").Select
         Selection.PasteSpecial Paste:=xlPasteValues, Transpose:=True
    Application.CutCopyMode = False
    End Sub
    or without activating afrekening december2006.xls

    Sub Copy1()
    
    Range("P389:P390").Copy
    Workbooks("afrekening december2006.xls").Sheets("sheet1").Range("E6:F6") _
    .PasteSpecial Paste:=xlPasteValues, Transpose:=True
    Application.CutCopyMode = False
    End Sub
    VBA Noob
    Last edited by VBA Noob; 12-25-2006 at 06:24 PM.
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

+ Reply to Thread

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