Hello,
I have a VBA code which transfers mutiple rows of data from multiple workbooks to master workbook.
Sub Compilation()
Dim FolderPath As String, Filepath As String, Filename As String
FolderPath = "H:\Test\"
Filepath = FolderPath & "*.xls*"
Filename = Dir(Filepath)
Dim lastrow As Long, lastcolumn As Long
Do While Filename <> ""
Workbooks.Open (FolderPath & Filename)
lastrow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
lastcolumn = ActiveSheet.Cells(2, Columns.Count).End(xlToLeft).Column
Range(Cells(3, 1), Cells(lastrow, lastcolumn)).Copy
Application.DisplayAlerts = False
ActiveWorkbook.Close
erow = Sheet1.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
lastcolumn = ActiveSheet.Cells(1, Columns.Count).End(xlToLeft).Column
ActiveSheet.Paste Destination:=Worksheets("Sheet1").Range(Cells(erow, 1), Cells(erow, lastcolumn))
Filename = Dir
Loop
End Sub
But I am looking out for a VBA code which should transfer only a specific row of data from multiple workbooks to master workbook using VBA. I want only the data which is present in ROW 3 to be transferred to master workbook.
I have attached 4 samples of spread sheet for your reference. Can someone please HELP me on this!
Bookmarks