Results 1 to 4 of 4

Thread: Copy - pasting macro
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Dec 2004
    Posts
    172
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Copy - pasting macro

    Hi there
    I have 2 workbooks opened at the same time. Lets call them workbook1 and worbook2.
    I have workbook1 opened and I recorded a macro. In workbook1 I copy the range A2:H158 into workbook2
    Here is a partial recorded code


    Range("A2:H158").Select
    Selection.Copy
    Windows("workbook2.xlsx").Activate
    Sheets("Sheet1").Select
    Range("A2").Select
    ActiveSheet.Paste

    Here is what happened. Workbook2 did not open up when I ran the macro even though it opened up when I recorded the macro. Is there a different code I can use instead of Windows("workbook2.xlsx").Activate?

    Thanks in advance.

  2. #2
    Board Regular Logit's Avatar
    Join Date
    Aug 2016
    Location
    United States
    Posts
    2,900
    Post Thanks / Like
    Mentioned
    39 Post(s)
    Tagged
    1 Thread(s)

  3. #3
    Board Regular
    Join Date
    Dec 2004
    Posts
    172
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Copy - pasting macro

    Thank You

  4. #4
    Board Regular Logit's Avatar
    Join Date
    Aug 2016
    Location
    United States
    Posts
    2,900
    Post Thanks / Like
    Mentioned
    39 Post(s)
    Tagged
    1 Thread(s)

    Default Re: Copy - pasting macro

    You are welcome.

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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