Hello everyone,
I'm newbie at VBA but still learning
I need a macro that combines every row from a worksheet to another one.
Sample Files: https://www.dropbox.com/sh/17ukkp4dgnudle7/AAAF7GUewNXekZdkVvHh2xVFa?dl=0
In this files, you see 4 sample files and 1 combined file.. every file structure is dynamic, so i think every file run rule like "copy all rows that's not empty." and they've grouping too.
I made a macro that inserting columns G,M,Z columns.
we can integrate this too but this will be first step.
1) Insert empty columns G,M,Z. (In these we're selecting folder, it applies every workbook in this folder)
2) Copy rows with grouping for file 1.xlsx (Starting with A3)
3) Create a workbook, paste. (for example Final.xslx)
4) Copy rows with grouping for file 2.xlsx (Starting with A3)
5) In the final.xslx search empty column in A column (after 1.xslx) and paste it with grouping.
it goes like this.
I'm very appreciated
I'm newbie at VBA but still learning
I need a macro that combines every row from a worksheet to another one.
Sample Files: https://www.dropbox.com/sh/17ukkp4dgnudle7/AAAF7GUewNXekZdkVvHh2xVFa?dl=0
In this files, you see 4 sample files and 1 combined file.. every file structure is dynamic, so i think every file run rule like "copy all rows that's not empty." and they've grouping too.
I made a macro that inserting columns G,M,Z columns.
Code:
Sub LoopThroughFiles() Dim xFd As FileDialog
Dim xFdItem As Variant
Dim xFileName As String
Set xFd = Application.FileDialog(msoFileDialogFolderPicker)
If xFd.Show = -1 Then
xFdItem = xFd.SelectedItems(1) & Application.PathSeparator
xFileName = Dir(xFdItem & "*.xls*")
Do While xFileName <> ""
With Workbooks.Open(xFdItem & xFileName)
'Açılacak olan kolonları yaz.
Range("G1").EntireColumn.Insert
Range("M1").EntireColumn.Insert
Range("Z1").EntireColumn.Insert
'Açık olan her workbook için kaydedip çıkar.
For Each w In Application.Workbooks
w.Save
Next w
ActiveWorkbook.Close SaveChanges:=True
End With
xFileName = Dir
Loop
End If
End Sub
we can integrate this too but this will be first step.
1) Insert empty columns G,M,Z. (In these we're selecting folder, it applies every workbook in this folder)
2) Copy rows with grouping for file 1.xlsx (Starting with A3)
3) Create a workbook, paste. (for example Final.xslx)
4) Copy rows with grouping for file 2.xlsx (Starting with A3)
5) In the final.xslx search empty column in A column (after 1.xslx) and paste it with grouping.
it goes like this.
I'm very appreciated