Column "D" will be always blank. So, Column "C" data needs to be paste into Column "D".Okay. But what if col. C from the more than one file needs to be pasted in col. D of one sheet? Data needs to be appended then?
Sub CopyDataFromColumnC()
Dim swb As Workbook, wb As Workbook
Dim sws As Worksheet, ws As Worksheet
Dim lr As Long, i As Long
Dim fso As Object
Dim dFolder As Object
Dim dFile As Object
Dim SelectedFolder As String
Application.ScreenUpdating = False
Set swb = ThisWorkbook
Set fso = CreateObject("Scripting.FileSystemObject")
With Application.FileDialog(msoFileDialogFolderPicker)
.Title = "Select A Folder!"
.ButtonName = "Confirm"
If .Show = -1 Then
SelectedFolder = .SelectedItems(1)
Set dFolder = fso.GetFolder(SelectedFolder)
Else
MsgBox "You didn't select a folder.", vbExclamation, "Folder Not Selected!"
Exit Sub
End If
End With
For Each dFile In dFolder.Files
If Left(fso.GetExtensionName(dFile), 4) = "xlsx" Then
Workbooks.Open dFile
Set wb = ActiveWorkbook
For i = 1 To wb.Worksheets.Count
Set ws = wb.Sheets(i)
On Error Resume Next
Set sws = swb.Sheets(i)
On Error GoTo 0
If Not sws Is Nothing Then
lr = ws.Cells(Rows.Count, 3).End(xlUp).Row
If lr > 1 Then
ws.Range("C2:C" & lr).Copy sws.Range("D" & Rows.Count).End(3)(2)
End If
End If
Set sws = Nothing
Next i
wb.Close True
End If
Set wb = Nothing
Next dFile
Application.ScreenUpdating = True
MsgBox "Data from Column C from all the files has been successfully copied.", vbInformation, "Done!"
End Sub
https://raywoodcockslatest.wordpress.com/2014/11/29/excel-for-batch/