Hi all,
I have little issue here.
I have 100 files in one directory and I wanted to consolidate them all in one single file. For that I have following code:
Sub ConsolidateData()
'
' ConsolidateData Macro
'
Dim file As String
Dim path As String
path = InputBox("Type the file part ending with '\'")
file = Dir(path)
Do While file <> ""
' ChDir (path)
Workbooks.Open Filename:=path & file
Range("A65000").Select
Selection.End(xlUp).Select
'open the file and select the range
Selection.CurrentRegion.Select
Selection.Copy
'copy the data
Windows("Daily_Report_Data_Consolidation_MACRO.xlsm").Activate
Range("A1000000").Select
Selection.End(xlUp).Select
ActiveCell.Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
' close file
Windows(file).Activate
ActiveWindow.Close
file = Dir
Loop
'ActiveWorkbook.SaveAs Filename:="F:\Branches\all.xlsx", _
' FileFormat:=xlOpenXMLWorkbook, CreateBackup:=True
End Sub
The branch files looks like this:
A B C D E F G
1 Date Number Name Comment Type Channel Branch
2 07 Февруари 2012 г. 72397801245 Name here 1 Comment 1 Campaign DM 098-IUO
3 07 Февруари 2012 г. 72397801245 Name here 1 Comment 2 Repeat IVR 067-MNB
4 07 Февруари 2012 г. 72397801245 Name here 1 Comment 3 New Internet 065-NBV
The code above works perfectly but copy the first row from branches files. I don't want to does that. I want to skip range A1:G1.
Please could someone provide me help and to modify this code?
The consolidation file in blank.
Fell free to use this code.
Bookmarks