- 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
aşağıdaki makro ile 4000 personelin resimlerini çalışma sayfama 4 dk da getirtiyorum acaba bu makro revize edilerek süre dahada kısaltılabilirmi. Yardımlarınız için şimdiden teşekkürler
Sub resim_71()
Son = 3
ReDim uzanti(Son)
uzanti(1) = ".bmp"
uzanti(2) = ".jpg"
uzanti(3) = ".gif"
With Application
.DisplayAlerts = False: .ScreenUpdating = False: .Calculation = xlCalculationAutomatic
End With
Klasor = "C:\FOTO\"
For i = 8 To Cells(Rows.Count, "B").End(3).Row
isim = Cells(i, 2).Value
deg = 0
For j = 1 To Son
If CreateObject("Scripting.FileSystemObject").FileExists(Klasor & isim & uzanti(j)) = True Then
ActiveSheet.Pictures.Insert(Klasor & isim & uzanti(j)).Select
Selection.Top = Cells(i, 10).Top + 2
Selection.Left = Cells(i, 10).Left + 2
Selection.ShapeRange.LockAspectRatio = msoFalse
Selection.ShapeRange.Height = Cells(i, 10).Height - 4
Selection.ShapeRange.Width = Cells(i, 10).Width - 4
deg = 1
Sheets("KONTROL").Range("a8").Select
Exit For
End If
Next
If deg = 0 Then
If CreateObject("Scripting.FileSystemObject").FileExists(Klasor & "d.jpg") = True Then
ActiveSheet.Pictures.Insert(Klasor & "d.jpg").Select
Selection.Top = Cells(i, 10).Top + 2
Selection.Left = Cells(i, 10).Left + 2
Selection.ShapeRange.LockAspectRatio = msoFalse
Selection.ShapeRange.Height = Cells(i, 10).Height - 4
Selection.ShapeRange.Width = Cells(i, 10).Width - 4
End If
End If
Next
End Sub
Sub resim_71()
Son = 3
ReDim uzanti(Son)
uzanti(1) = ".bmp"
uzanti(2) = ".jpg"
uzanti(3) = ".gif"
With Application
.DisplayAlerts = False: .ScreenUpdating = False: .Calculation = xlCalculationAutomatic
End With
Klasor = "C:\FOTO\"
For i = 8 To Cells(Rows.Count, "B").End(3).Row
isim = Cells(i, 2).Value
deg = 0
For j = 1 To Son
If CreateObject("Scripting.FileSystemObject").FileExists(Klasor & isim & uzanti(j)) = True Then
ActiveSheet.Pictures.Insert(Klasor & isim & uzanti(j)).Select
Selection.Top = Cells(i, 10).Top + 2
Selection.Left = Cells(i, 10).Left + 2
Selection.ShapeRange.LockAspectRatio = msoFalse
Selection.ShapeRange.Height = Cells(i, 10).Height - 4
Selection.ShapeRange.Width = Cells(i, 10).Width - 4
deg = 1
Sheets("KONTROL").Range("a8").Select
Exit For
End If
Next
If deg = 0 Then
If CreateObject("Scripting.FileSystemObject").FileExists(Klasor & "d.jpg") = True Then
ActiveSheet.Pictures.Insert(Klasor & "d.jpg").Select
Selection.Top = Cells(i, 10).Top + 2
Selection.Left = Cells(i, 10).Left + 2
Selection.ShapeRange.LockAspectRatio = msoFalse
Selection.ShapeRange.Height = Cells(i, 10).Height - 4
Selection.ShapeRange.Width = Cells(i, 10).Width - 4
End If
End If
Next
End Sub