Merhaba,
Bu kodlamayı ADO ile çalışır hale nasıl getirebiliriz?
Yardımcı olur musunuz?
Saygılarımla...
Bu kodlamayı ADO ile çalışır hale nasıl getirebiliriz?
Yardımcı olur musunuz?
Saygılarımla...
Kod:
Option Explicit
Sub DATA_AL()
Dim Sehir As String
Dim Durum As String
Dim Sonuc As Range
Dim SonSatır As Long
Dim i As Integer
Dim j As Integer
Workbooks.Open (ThisWorkbook.Path & "\DATA.xlsx")
For i = 1 To Worksheets.Count
Sehir = Sheets(i).Name
j = 2
Do While Workbooks("RAPOR.xlsm").Worksheets("SAYFA_RAPOR").Cells(j, 1) <> Empty
Durum = Workbooks("RAPOR.xlsm").Worksheets("SAYFA_RAPOR").Cells(j, 1)
Set Sonuc = Worksheets(Sehir).Rows(1).Find(Durum, , xlValues, xlWhole)
If Not Sonuc Is Nothing Then
SonSatır = Worksheets(Sehir).Cells(Rows.Count, Sonuc.Column + 5).End(xlUp).Row
Workbooks("RAPOR.xlsm").Worksheets("SAYFA_RAPOR").Cells(j, 2) = _
Workbooks("RAPOR.xlsm").Worksheets("SAYFA_RAPOR").Cells(j, 2) + _
Worksheets(Sehir).Cells(SonSatır, Sonuc.Column + 5)
Else
End If
j = j + 1
Loop
Next i
Workbooks("DATA.xlsx").Close
MsgBox "İşlem tamamlandı.", vbInformation, "RAPOR"
End Sub
