Hello,
I would like to create a VBA code which will go through a folder where there are excel files and copy as value the column U of the first sheet of each excel file to the column V.
I came up with this for now but I am getting an error and this code is more likely to copy the column U as value on the column U itself while I want to copy it on column V
I would like to create a VBA code which will go through a folder where there are excel files and copy as value the column U of the first sheet of each excel file to the column V.
I came up with this for now but I am getting an error and this code is more likely to copy the column U as value on the column U itself while I want to copy it on column V
VBA Code:
Sub OpenAndPerformMacros()
Dim strF As String, strP As String
Dim wb As Workbook
Dim ws As Worksheet
'Edit this declaration to your folder name
strP = "Path\New folder"
strF = Dir(strP & "\*.xlsx") 'Change as required
Do While strF <> vbNullString
Set wb = Workbooks.Open(strP & "\" & strF)
Set ws = wb.Sheets(1).Column("U")
ws.Cells.Copy
ws.Cells.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
wb.Close True
strF = Dir()
Loop
End Sub