DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Sub DosyaBirlestir()
Dim YazSat As Long, _
SonSat As Long, _
Yol As String, _
Kol As Integer, _
Dosya As String
Kol = Cells(1, Columns.Count).End(1).Column
Application.ScreenUpdating = False
YazSat = Cells(Rows.Count, "A").End(3).Row
If YazSat < 2 Then YazSat = 2
Range(Cells(2, "A"), Cells(YazSat, Kol)).ClearContents
Yol = YolBul
Dosya = Dir(Yol & "*.xls*")
While Not Dosya = ""
Workbooks.Open Filename:=Dosya
SonSat = Cells(Rows.Count, "A").End(3).Row
Range(Cells(2, "A"), Cells(SonSat, Kol)).Copy
ActiveWindow.Close
YazSat = Cells(Rows.Count, "A").End(3).Row + 1
Range("A" & YazSat).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Dosya = Dir
Wend
Cells(1, Kol + 1).Activate
End Sub
Function YolBul()
Dim fdBrowser As FileDialog
Set fdBrowser = Application.FileDialog(msoFileDialogFolderPicker)
With fdBrowser
'İlk kullanıma aç
.Title = "Metin (Text) Dosyasını Seçiniz"
.InitialFileName = "C:\"
'İletişim Kutusunu Göster
If .Show Then
YolBul = .SelectedItems(1) & Application.PathSeparator
Else
YolBul = ""
End If
End With
End Function