Solved

VBA to Copy a worksheet to another workbook

Posted on 2016-11-08
3
89 Views
Last Modified: 2016-11-09
Good Afternoon Everyone,

I have two workbooks where i want Excel to automatically update the table in one sheet based on the other one.
i want the table in workbook MergetestSheet!2015 to automatically update based on the table in workbook 2015Sheet!1 Range A1:p144,031. Can someone help with the VBA code?

Thanks
0
Comment
Question by:Dokat
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 30

Expert Comment

by:Randy Downs
ID: 41880632
Try recording the VBA via the Developer tab while copying the table from Workbook 2015Sheet!1 Range A1:p144,031 to MergetestSheet!2015
0
 
LVL 30

Accepted Solution

by:
Randy Downs earned 500 total points
ID: 41880667
I created a macro by recording my copy and ended uo wit hthe following. You will want your range to cover your entire table & this macro assumes both files are open.

Sub Macro2()
'
' Macro2 Macro
'

'
    Windows("workbook 2015.xlsx").Activate
    Range("A2:O41").Select

    Range("Table1").Select
    Selection.Copy
    Windows("MergetestSheet.xlsx").Activate
    Range("A2").Select
    ActiveSheet.Paste

End Sub

Open in new window

0
 

Author Closing Comment

by:Dokat
ID: 41880670
Thank you so much Randy!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question