DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, [L4]) Is Nothing Then Exit Sub
Set s1 = Sheets("VERİ")
son = s1.Cells(Rows.Count, "B").End(3).Row
eski = WorksheetFunction.Max(8, Cells(Rows.Count, "B").End(3).Row)
Range("A5:J" & eski).ClearContents
If WorksheetFunction.CountIf(s1.Range("B4:B" & son), Target) = 0 Then
MsgBox Target & " ilçesine ait tesis bulunmamaktadır.", vbInformation
Else
Application.ScreenUpdating = False
Set con = VBA.CreateObject("adodb.Connection")
con.Open "provider=microsoft.ace.oledb.12.0;data source=" & _
ThisWorkbook.FullName & ";extended properties=""Excel 12.0;hdr=yes"""
sorgu = "select İlçesi,[Tesis Türü],[İşin Adı],year([İş Bitiş Tarihi]),Açıklama,[2020 YILI FİYATLARI İLE TOPLAM MALİYET] " & _
"from[VERİ$A2:BU" & son & "] where [İlçesi]='" & Target & "'"
Set rs = con.Execute(sorgu)
[C8].CopyFromRecordset rs
enson = Cells(Rows.Count, "B").End(3).Row
For i = 8 To son
Cells(i, "B") = i - 7
Next
Range("F8:F" & enson).NumberFormat = "General"
Application.ScreenUpdating = True
End If
End Sub
[2020 YILI FİYATLARI İLE TOPLAM MALİYET][TOPLAM MALİYET]