Solved

VBA to Copy a worksheet to another workbook

Posted on 2016-11-08
3
71 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
  • 2
3 Comments
 
LVL 29

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 29

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

813 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now