DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Workbooks(Last_File).Close False
Last_File = Right(Last_File, Len(Last_File) - InStrRev(Last_File, "\"))
Last_File = Right(Last_File, Len(Last_File) - InStrRev(Last_File, "\"))
Workbooks(Last_File).Close False
Sub Ekle()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Dim Kitapadi As String
Dim FSO As Object, Source_Folder As Object
Dim My_Path As String, My_File As Object
Dim My_File_Extension As String
Dim Last_Date As Date, Last_File As String
My_Path = Environ("UserProfile") & "\Downloads"
My_File_Extension = "xls"
Set FSO = VBA.CreateObject("Scripting.FileSystemObject")
Set Source_Folder = FSO.GetFolder(My_Path)
For Each My_File In Source_Folder.Files
If My_File.DateLastModified > Last_Date Then
If InStr(1, FSO.GetExtensionName(My_File), My_File_Extension) > 0 Then
Last_File = My_File
Last_Date = My_File.DateLastModified
End If
End If
Next
Workbooks.Open Last_File, False, False
Range("a1").Select
If Range("I6").Value <> "İŞLETMEDEKİ SIĞIR-MANDA TÜRÜ HAYVAN BİLGİ RAPORU" Then
MsgBox ("Lütfen doğru liste seçiniz!"), vbCritical, "Hatalı Liste!"
Else
Sheets(1).Copy After:=Sheets(Sheets.Count)
Sheets(Sheets.Count).Range("A12:AR" & Rows.Count).ClearContents
For i = 1 To Sheets.Count
If Sheets(i).Name <> Sheets(Sheets.Count).Name Then
son = Sheets(i).Cells(Rows.Count, "C").End(3).Row
yeni = WorksheetFunction.Max(12, Sheets(Sheets.Count).Cells(Rows.Count, "C").End(3).Row + 1)
Sheets(i).Range("C12:AO" & son).Copy Sheets(Sheets.Count).Cells(yeni, "C")
End If
Next
Cells.Select
Selection.Copy
Windows("Ana Uygunluk & Tarih Aralıkları Programı.xlsm").Activate
Worksheets("Animals").Visible = xlSheetVisible
Sheets("Animals").Select
Cells.Select
Range("a1").Activate
ActiveSheet.Paste
Worksheets("Animals").Visible = xlSheetVeryHidden
Worksheets("Sayfa4").Visible = xlSheetVeryHidden
Sheets("Ana Sayfa").Select
Range("A1").Select
MsgBox ("Hayvan Varlığı Listesi Başarıyla Yüklendi."), vbInformation
Last_File = Right(Last_File, Len(Last_File) - InStrRev(Last_File, "\"))
Workbooks(Last_File).Close False
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End If
End Sub
Dim wb As Workbook
For Each wb In Workbooks
If wb.Name <> ThisWorkbook.Name Then
wb.Close SaveChanges:=False
End If
Next wb