- Katılım
- 1 Ağustos 2019
- Mesajlar
- 839
- Excel Vers. ve Dili
-
Türkçe excel 2016
İngilizce excel 2016
- Altın Üyelik Bitiş Tarihi
- 19-10-2021
Kod:
Sub KOPYALA()
Dim A As Object, dsy As String
Dim Klas1 As String
Dim Klas2 As String
Klas1 = "C:\GKK_PDF\" 'VERİ ALINACAK KLASÖR
Klas2 = "C:\KLASOR1\" 'VERİ KOPYALANACAK KLASÖR
Set A = CreateObject("scripting.filesystemobject")
If Not A.FolderExists(Klas2) Then MkDir Klas2
For i = 2 To Cells(Rows.Count, "A").End(3).Row
If Trim(Cells(i, "A").Value) <> "" Then
dsy = Dir(Klas1 & Trim(Cells(i, "A").Value) & "*.*", vbDirectory)
'dsy = Trim(Cells(i, "A").Value) & ".pdf" 'sadece tc kimlik no
If A.FileExists(Klas1 & dsy) = True Then
A.copyFile Source:=Klas1 & dsy, Destination:=Klas2 & "\" ' PDF KOPYALAMA
Cells(i, "A").Interior.ColorIndex = 4
Else
Cells(i, "A").Interior.ColorIndex = 3
End If: End If
Next
MsgBox "işlem tamam"
End Sub