Soru 5 adet kapalı dosyadan çokeğersay yöntemi ile veri alma

muzos80

Altın Üye
Katılım
21 Aralık 2013
Mesajlar
45
Excel Vers. ve Dili
2013 - Türkçe
Altın Üyelik Bitiş Tarihi
27-01-2026
Merhaba, 5 adet kapalı excel dosyam var ve hepsi de aynı sütunlarda veri var sadece üniteleri farklı çalışanların bölümlere yazdıklarını çekmeye çalışıyorum aşağıdaki kod da bunu yaptım ama + diyerek diğer excel dosyalarından da aynı kişiye ait verileri çokğersay ile saydırmaya çalışıyorum tek dosyada veri alıyor ama + deyince 0 değer veriyor, bu sorunu nasıl halledebilirim



ThisWorkbook.Sheets("BOG").Range("R125:T158").ClearContents
yol = ThisWorkbook.Sheets("BOG").Range("AB59") & "\" 'Dosyanın adresi
' AÇILACAK EXCEL DOSYALARI
Set exel1 = Workbooks.Open(yol & ThisWorkbook.Sheets("BOG").Range("AB60"))
Set exel2 = Workbooks.Open(yol & ThisWorkbook.Sheets("BOG").Range("AB61"))
Set exel3 = Workbooks.Open(yol & ThisWorkbook.Sheets("BOG").Range("AB62"))
Set exel4 = Workbooks.Open(yol & ThisWorkbook.Sheets("BOG").Range("AB63"))
Set exel5 = Workbooks.Open(yol & ThisWorkbook.Sheets("BOG").Range("AB64"))
' Çalışan 1 kişi için
'Beyazları toplatma
ThisWorkbook.Sheets("BOG").Range("R125") = exel1.Application.WorksheetFunction.CountIfs(Range("d5:d10000"), "Beyaz", Range("g5:g10000"), ThisWorkbook.Sheets("BOG").Range("Q125")) + _
exel2.Application.WorksheetFunction.CountIfs(Range("d5:d10000"), "Beyaz", Range("g5:g10000"), ThisWorkbook.Sheets("BOG").Range("Q125")) + _
exel3.Application.WorksheetFunction.CountIfs(Range("d5:d10000"), "Beyaz", Range("g5:g10000"), ThisWorkbook.Sheets("BOG").Range("Q125")) + _
exel4.Application.WorksheetFunction.CountIfs(Range("d5:d10000"), "Beyaz", Range("g5:g10000"), ThisWorkbook.Sheets("BOG").Range("Q125")) + _
exel5.Application.WorksheetFunction.CountIfs(Range("d5:d10000"), "Beyaz", Range("g5:g10000"), ThisWorkbook.Sheets("BOG").Range("Q125"))
' Kırmızıları toplatma
ThisWorkbook.Sheets("BOG").Range("S125") = exel1.Application.WorksheetFunction.CountIfs(Range("d5:d10000"), "Kırmızı", Range("g5:g10000"), ThisWorkbook.Sheets("BOG").Range("Q125")) + _
exel2.Application.WorksheetFunction.CountIfs(Range("d5:d10000"), "Kırmızı", Range("g5:g10000"), ThisWorkbook.Sheets("BOG").Range("Q125")) + _
exel3.Application.WorksheetFunction.CountIfs(Range("d5:d10000"), "Kırmızı", Range("g5:g10000"), ThisWorkbook.Sheets("BOG").Range("Q125")) + _
exel4.Application.WorksheetFunction.CountIfs(Range("d5:d10000"), "Kırmızı", Range("g5:g10000"), ThisWorkbook.Sheets("BOG").Range("Q125")) + _
exel5.Application.WorksheetFunction.CountIfs(Range("d5:d10000"), "Kırmızı", Range("g5:g10000"), ThisWorkbook.Sheets("BOG").Range("Q125"))
' yeşilleri toplatma
ThisWorkbook.Sheets("BOG").Range("T125") = exel1.Application.WorksheetFunction.CountIfs(Range("d5:d10000"), "Yeşil", Range("g5:g10000"), ThisWorkbook.Sheets("BOG").Range("Q125")) + _
exel2.Application.WorksheetFunction.CountIfs(Range("d5:d10000"), "Yeşil", Range("g5:g10000"), ThisWorkbook.Sheets("BOG").Range("Q125")) + _
exel3.Application.WorksheetFunction.CountIfs(Range("d5:d10000"), "Yeşil", Range("g5:g10000"), ThisWorkbook.Sheets("BOG").Range("Q125")) + _
exel4.Application.WorksheetFunction.CountIfs(Range("d5:d10000"), "Yeşil", Range("g5:g10000"), ThisWorkbook.Sheets("BOG").Range("Q125")) + _
exel5.Application.WorksheetFunction.CountIfs(Range("d5:d10000"), "Yeşil", Range("g5:g10000"), ThisWorkbook.Sheets("BOG").Range("Q125"))
exel1.Close True
exel2.Close True
exel3.Close True
exel4.Close True
exel5.Close True

Set exel1 = Nothing
Set exel2 = Nothing
Set exel3 = Nothing
Set exel4 = Nothing
Set exel5 = Nothing
Application.ScreenUpdating = True
End Sub
 

Korhan Ayhan

Administrator
Yönetici
Admin
Katılım
15 Mart 2005
Mesajlar
41,454
Excel Vers. ve Dili
Microsoft 365 Tr-En 64 Bit
Örnek dosya paylaşarak neyi nereye hangi formatta aktarmak istediğinizi açıklarsanız yardım almanız kolaylaşır.
 
Üst