O
ojj00u
Hi,
I am currently using this piece of code:
Sub GetSheets()
Dim sPath As String, i As Long
Dim varr As Variant
Dim wkbk As Workbook
sPath = "H:\Work\metSLA\December\ResolverGroup\"
varr = Array("metslareportWE0512.xls", "metslareportWE1212.xls",
"metslareportWE191203.xls", "metslareportWE020104.xls")
For i = LBound(varr) To UBound(varr)
Set wkbk = Workbooks.Open(sPath & varr(i))
wkbk.Worksheets(1).Copy After:=ThisWorkbook. _
Worksheets(ThisWorkbook.Worksheets.Count)
wkbk.Close SaveChanges:=False
Next
End Sub
to combine the named files in the array into one workbook. However I
know very little about VB so am unable to edit this piece of code so
that all the combined workbooks are pasted into one worksheet as
opposed to separate ones. It must be very simple to merely append the
information to the end of the last paste but have been trying for a
while and getting a little dispondent!
For example if the first file used rows 1-200, then I want the second
file to fill from row 201 - end etc etc
Please help!!
I am currently using this piece of code:
Sub GetSheets()
Dim sPath As String, i As Long
Dim varr As Variant
Dim wkbk As Workbook
sPath = "H:\Work\metSLA\December\ResolverGroup\"
varr = Array("metslareportWE0512.xls", "metslareportWE1212.xls",
"metslareportWE191203.xls", "metslareportWE020104.xls")
For i = LBound(varr) To UBound(varr)
Set wkbk = Workbooks.Open(sPath & varr(i))
wkbk.Worksheets(1).Copy After:=ThisWorkbook. _
Worksheets(ThisWorkbook.Worksheets.Count)
wkbk.Close SaveChanges:=False
Next
End Sub
to combine the named files in the array into one workbook. However I
know very little about VB so am unable to edit this piece of code so
that all the combined workbooks are pasted into one worksheet as
opposed to separate ones. It must be very simple to merely append the
information to the end of the last paste but have been trying for a
while and getting a little dispondent!
For example if the first file used rows 1-200, then I want the second
file to fill from row 201 - end etc etc
Please help!!