Macro to Move or Copy Data Between Excel Workbooks [Link]
Macro to Move or Copy Data You May Like Sponsored Links
Between Excel Workbooks Watch: An Amazing 360 Experience Of Abu
Dhabi's Sights And Sounds
CNN for Abu Dhabi Tourism
Lazy weight loss! No diets and workouts!
This article will teach you how to Trends-health
copy or transfer data between
spreadsheets in Microsoft Excel
using VBA. In this particular End Your Nightly Snoring Nightmare With
example, we will also teach you how This Simple Solution
My Snoring Solution
to combine data by using an append
query. This combination of tasks will allow you to combine
data in existing worksheets for easier analysis. 15 chambres d'hôtel dont le prix peut
choquer
Rich & Richer
Macro to Move or Copy Data in
Excel by Taboola
Let's take a case in which you need to copy data from one
workbook and then amend the content to another workbook. In
this example, workbook one (the source workbook) has 1 2 3 4
5 and workbook two has 6 7 8 9 0. After running the macro,
workbook two should have 6 7 8 9 0 1 2 3 4 5. The formats of
both workbooks is the same. Here is a macro that could
transfer and append your data. (Make sure that you read the
NOTE in the code):
1 of 3 3/13/2017 9:21 PM
Macro to Move or Copy Data Between Excel Workbooks [Link]
Sub CopyData()
Dim sBook_t As String Dim sBook_s As String Dim
sSheet_t As String Dim sSheet_s As String Dim
lMaxRows_t As Long Dim lMaxRows_s As Long Dim
sMaxCol_s As String Dim sRange_t As String Dim
sRange_s As String sBook_t = "Target Data WB-
Copy data to [Link]" sBook_s = "Source Data WB
- Copy data to [Link]" sSheet_t =
"Target WB" sSheet_s = "Source"
lMaxRows_t =
Workbooks(sBook_t).Sheets(sSheet_t).Cells([Link],
"A").End(xlUp).Row lMaxRows_s =
Workbooks(sBook_s).Sheets(sSheet_s).Cells([Link],
"A").End(xlUp).Row sMaxCol_s =
Workbooks(sBook_s).Sheets(sSheet_s).Cells(1,
[Link]).End(xlToLeft).Address sMaxCol_s
= Mid(sMaxCol_s, 2, InStr(2, sMaxCol_s, "$") - 2)
If (lMaxRows_t = 1) Then sRange_t = "A1:" &
sMaxCol_s & lMaxRows_s sRange_s = "A1:" &
sMaxCol_s & lMaxRows_s
Workbooks(sBook_t).Sheets(sSheet_t).Range(sRange_t) =
Workbooks(sBook_s).Sheets(sSheet_s).Range(sRange_s).V
alue Else sRange_t =
"A" & (lMaxRows_t + 1) & ":" & sMaxCol_s &
(lMaxRows_t + lMaxRows_s - 1) sRange_s =
"A2:" & sMaxCol_s & lMaxRows_s
Workbooks(sBook_t).Sheets(sSheet_t).Range(sRange_t) =
Workbooks(sBook_s).Sheets(sSheet_s).Range(sRange_s).V
alue ' ######################
NOTE ################# 'the following lines
are to be used of serial number is to be fixed too,
instead of being copied ' if there is no
need, then delete the line below
Workbooks(sBook_t).Sheets(sSheet_t).Range("A" &
lMaxRows_t).AutoFill
Destination:=Workbooks(sBook_t).Sheets(sSheet_t).Rang
e("A" & lMaxRows_t & ":A" & (lMaxRows_t + lMaxRows_s
- 1)), Type:=xlFillSeries End If
End Sub
You May Like Sponsored Links
20 Early Warning Signs Of Cancer You Shouldn't Ignore
[Link]
The Biggest Company the Year You Were Born
24/7 Wall St.
2 of 3 3/13/2017 9:21 PM
Macro to Move or Copy Data Between Excel Workbooks [Link]
A Solution That Puts Snoring to Bed
My Snoring Solution
Finally You Can Track Your Car Using Your Smartphone
Smart Device Trends
Tiny, Powerful, Flameless Lighter is Selling Like Crazy (it's
Genius!)
Inferno USB Lighter
A new way to get rid of overweight without doctors and
surgery!
Trends-health
by Taboola
This document, titled "Macro to Move or Copy Data Between Excel
Workbooks," is available under the Creative Commons license. Any copy,
reuse, or modification of the content should be sufficiently credited to CCM
([Link]).
3 of 3 3/13/2017 9:21 PM