Soru Üst Hücre Dolu İse Atla; Boş İse Kabul Et ve Kopyala

RBozkurt

𐱅𐰇𐰼𐰚
Altın Üye
Katılım
10 Ocak 2018
Mesajlar
681
Excel Vers. ve Dili
Microsoft Office 2024
Google Sheets
Altın Üyelik Bitiş Tarihi
19-12-2026
Merhaba,
Buradaki konuya istinaden farklı bir uygulama için tekrardan yardımlarınıza ihtiyacım var.

Öncelikle ilgili kod çalışıyor. Sadece ufak bir değişiklik yapılması gerekli. Veriler gelirken ufak bir hata oluşmakta maalesef geç fark ettim.

Uygulama şu şekilde;
* NetcadRapor sayfasındaki L sütununda eğer TC var ise MernisListe sayfası G sütununda arama yapıyor ve bu satırla birlikte altındaki satırları ÖnÇalışma sayfasına kopyalıyor.

*NetcadRapor sayfasındaki L sütunu boş, 0 veya TC YOK ise bu satırdaki veriyi ÖnÇalışma sayfasına kopyalıyor.
Buraya kadar problemsiz şekilde çalışmaktadır.
( @Ömer beyin eline sağlık. )

Düzeltilmesi gereken;
"* NetcadRapor sayfasındaki L sütununda eğer TC var ise MernisListe sayfası G sütununda arama yapıyor ve bu satırla birlikte altındaki satırları ÖnÇalışma sayfasına kopyalıyor." bu uygulamayı yaparken örneğe eklemiş olduğum dosyada renk ve not ekleyerek de açıklamaya çalıştım;

Normal şartlarda MernisListe sayfasında arama yaparken boş hücreden sonra gelen (sarı renkli ilk TC'ler) ilgili TC numarasını baz alması lazım.
Fakat aynı TC numarası farklı bir kişinin varisi olarak varsa ve oda listede daha önde ise onu baz alıyor ve altındaki ilgisiz kişileri de ÖnÇalışma sayfasına aktarılıyor.

*** Bu hata sanırım arama işlemi yapılırken eğer MernisListe sayfası G sütununda ilgili TC noyu bulunca bir yukarı hücre dolu ise atlasın, BOŞ ise kabul edip kopyalasın şeklinde olursa düzelebilir. ***

Bahsettiğim şekilde revizyon yapılabilir mi? Yardımcı olabilir misiniz?
Teşekkür ederim.



Kod:
Sub tc_bul_yeni()

    Dim S1 As Worksheet, S2 As Worksheet, S3 As Worksheet, son As Long
    Dim i As Long, c As Range, Adr As String, sat As Long, j As Long, s As Long, k As Integer

    Set S1 = Sheets("NetcadRapor")
    Set S2 = Sheets("MernisListe")
    Set S3 = Sheets("ÖnÇalışma")
    son = S2.Cells(Rows.Count, "G").End(xlUp).Row

    Application.ScreenUpdating = False
    Application.DisplayAlerts = False
    S3.Rows("2:" & Rows.Count).Clear

    sat = 2
    For i = 2 To S1.Cells(Rows.Count, "F").End(xlUp).Row
        Set c = S2.[G:G].Find(S1.Cells(i, "L"), , xlValues, xlWhole)
        If Not c Is Nothing And S1.Cells(i, "L") <> "" Then
            For j = c.Row To son
                If s = 0 Then s = sat
                If Len(S2.Cells(j, "G")) <> 11 Then
                    Exit For
                End If
                S3.Cells(sat, "C") = S1.Cells(i, "A")
                S3.Cells(sat, "D") = S1.Cells(i, "B")
                S3.Cells(sat, "E") = S1.Cells(i, "C")
                S3.Cells(sat, "H") = S2.Cells(j, "B")
                S3.Cells(sat, "I") = S2.Cells(j, "C")
                S3.Cells(sat, "F") = S1.Cells(i, "D")
                S3.Cells(sat, "G") = S1.Cells(i, "E")
                S3.Cells(sat, "J") = S1.Cells(i, "H")
                S3.Cells(sat, "K") = S1.Cells(i, "I")
                S3.Cells(sat, "L") = S1.Cells(i, "J")
                S3.Cells(sat, "M") = S1.Cells(i, "K")
                S3.Cells(sat, "T") = S2.Cells(j, "G")
                S3.Cells(sat, "U") = S2.Cells(j, "F")
                S3.Cells(sat, "V") = S2.Cells(j, "H")
                S3.Cells(sat, "W") = S2.Cells(j, "I")
                sat = sat + 1
            Next j
            For k = 3 To 13
                If k < 8 Or k > 9 Then
                    S3.Cells(s, k).Resize(sat - s, 1).MergeCells = True
                    S3.Cells(s, k).Resize(sat - s, 1).VerticalAlignment = xlCenter
                End If
            Next k
            s = 0
        Else
            S3.Cells(sat, "C") = S1.Cells(i, "A")
            S3.Cells(sat, "D") = S1.Cells(i, "B")
            S3.Cells(sat, "E") = S1.Cells(i, "C")
            S3.Cells(sat, "H") = S1.Cells(i, "F")
            S3.Cells(sat, "I") = S1.Cells(i, "G")
            S3.Cells(sat, "F") = S1.Cells(i, "D")
            S3.Cells(sat, "G") = S1.Cells(i, "E")
            S3.Cells(sat, "J") = S1.Cells(i, "H")
            S3.Cells(sat, "K") = S1.Cells(i, "I")
            S3.Cells(sat, "L") = S1.Cells(i, "J")
            S3.Cells(sat, "M") = S1.Cells(i, "K")
            S3.Cells(sat, "T") = S1.Cells(i, "L")
            sat = sat + 1
        End If
        sat = sat + 1
    Next i

    S3.Select
    Range("A2:AD" & sat - 2).Borders.LineStyle = 1

    MsgBox "Aktarım Tamamlandı.", vbInformation
    Application.DisplayAlerts = True
    Application.ScreenUpdating = True
   
End Sub
 

Ekli dosyalar

RBozkurt

𐱅𐰇𐰼𐰚
Altın Üye
Katılım
10 Ocak 2018
Mesajlar
681
Excel Vers. ve Dili
Microsoft Office 2024
Google Sheets
Altın Üyelik Bitiş Tarihi
19-12-2026
Merhaba. Konu ile ilgili yardım edebilirmisiniz?
 

Ömer

Moderatör
Yönetici
Katılım
18 Ağustos 2007
Mesajlar
22,184
Excel Vers. ve Dili
Microsoft 365 Tr
Ofis 2016 Tr
Merhaba,

Umarım doğru anlamışımdır.
Deneyiniz.
Kod:
Sub tc_bul_yeni()

    Dim S1 As Worksheet, S2 As Worksheet, S3 As Worksheet, son As Long
    Dim i As Long, c As Range, sat As Long, j As Long, s As Long, k As Integer

    Set S1 = Sheets("NetcadRapor")
    Set S2 = Sheets("MernisListe")
    Set S3 = Sheets("ÖnÇalışma")
    son = S2.Cells(Rows.Count, "G").End(xlUp).Row
 
    Application.ScreenUpdating = False
    Application.DisplayAlerts = False
    S3.Rows("2:" & Rows.Count).Clear
    
    sat = 2
    For i = 2 To S1.Cells(Rows.Count, "F").End(xlUp).Row
        Set c = S2.[G:G].Find(S1.Cells(i, "L"), , xlValues, xlWhole)
        If Not c Is Nothing And S1.Cells(i, "L") <> "" Then
            If Trim(S2.Cells(c.Row - 1, "G")) = "" Then
                For j = c.Row To son
                    If s = 0 Then s = sat
                    If Trim(S2.Cells(j, "G")) = "" Then
                        Exit For
                    End If
                    S2.Cells(j, "G") = S2.Cells(j, "G") & "|"
                    S3.Cells(sat, "C") = S1.Cells(i, "A")
                    S3.Cells(sat, "D") = S1.Cells(i, "B")
                    S3.Cells(sat, "E") = S1.Cells(i, "C")
                    S3.Cells(sat, "H") = S2.Cells(j, "B")
                    S3.Cells(sat, "I") = S2.Cells(j, "C")
                    S3.Cells(sat, "F") = S1.Cells(i, "D")
                    S3.Cells(sat, "G") = S1.Cells(i, "E")
                    S3.Cells(sat, "J") = S1.Cells(i, "H")
                    S3.Cells(sat, "K") = S1.Cells(i, "I")
                    S3.Cells(sat, "L") = S1.Cells(i, "J")
                    S3.Cells(sat, "M") = S1.Cells(i, "K")
                    S3.Cells(sat, "T") = S2.Cells(j, "G")
                    S3.Cells(sat, "U") = S2.Cells(j, "F")
                    S3.Cells(sat, "V") = S2.Cells(j, "H")
                    S3.Cells(sat, "W") = S2.Cells(j, "I")
                    sat = sat + 1
                Next j
                For k = 3 To 13
                    If k < 8 Or k > 9 Then
                        S3.Cells(s, k).Resize(sat - s, 1).MergeCells = True
                        S3.Cells(s, k).Resize(sat - s, 1).VerticalAlignment = xlCenter
                    End If
                Next k
                s = 0
                S2.Cells(c.Row, "G").Replace "|", "", xlPart
            End If
        Else
            S3.Cells(sat, "C") = S1.Cells(i, "A")
            S3.Cells(sat, "D") = S1.Cells(i, "B")
            S3.Cells(sat, "E") = S1.Cells(i, "C")
            S3.Cells(sat, "H") = S1.Cells(i, "F")
            S3.Cells(sat, "I") = S1.Cells(i, "G")
            S3.Cells(sat, "F") = S1.Cells(i, "D")
            S3.Cells(sat, "G") = S1.Cells(i, "E")
            S3.Cells(sat, "J") = S1.Cells(i, "H")
            S3.Cells(sat, "K") = S1.Cells(i, "I")
            S3.Cells(sat, "L") = S1.Cells(i, "J")
            S3.Cells(sat, "M") = S1.Cells(i, "K")
            S3.Cells(sat, "T") = S1.Cells(i, "L")
            sat = sat + 1
        End If
        sat = sat + 1
    Next i
 
    S3.Select
    Range("A2:AD" & sat - 2).Borders.LineStyle = 1
    S2.[G:G].Replace "|", "", xlPart
    [T:T].Replace "|", "", xlPart

    MsgBox "Aktarım Tamamlandı.", vbInformation
    Application.DisplayAlerts = True
    Application.ScreenUpdating = True
    
End Sub
 

RBozkurt

𐱅𐰇𐰼𐰚
Altın Üye
Katılım
10 Ocak 2018
Mesajlar
681
Excel Vers. ve Dili
Microsoft Office 2024
Google Sheets
Altın Üyelik Bitiş Tarihi
19-12-2026
Merhaba,

Umarım doğru anlamışımdır.
Deneyiniz.
Kod:
Sub tc_bul_yeni()

    Dim S1 As Worksheet, S2 As Worksheet, S3 As Worksheet, son As Long
    Dim i As Long, c As Range, sat As Long, j As Long, s As Long, k As Integer

    Set S1 = Sheets("NetcadRapor")
    Set S2 = Sheets("MernisListe")
    Set S3 = Sheets("ÖnÇalışma")
    son = S2.Cells(Rows.Count, "G").End(xlUp).Row

    Application.ScreenUpdating = False
    Application.DisplayAlerts = False
    S3.Rows("2:" & Rows.Count).Clear
   
    sat = 2
    For i = 2 To S1.Cells(Rows.Count, "F").End(xlUp).Row
        Set c = S2.[G:G].Find(S1.Cells(i, "L"), , xlValues, xlWhole)
        If Not c Is Nothing And S1.Cells(i, "L") <> "" Then
            If Trim(S2.Cells(c.Row - 1, "G")) = "" Then
                For j = c.Row To son
                    If s = 0 Then s = sat
                    If Trim(S2.Cells(j, "G")) = "" Then
                        Exit For
                    End If
                    S2.Cells(j, "G") = S2.Cells(j, "G") & "|"
                    S3.Cells(sat, "C") = S1.Cells(i, "A")
                    S3.Cells(sat, "D") = S1.Cells(i, "B")
                    S3.Cells(sat, "E") = S1.Cells(i, "C")
                    S3.Cells(sat, "H") = S2.Cells(j, "B")
                    S3.Cells(sat, "I") = S2.Cells(j, "C")
                    S3.Cells(sat, "F") = S1.Cells(i, "D")
                    S3.Cells(sat, "G") = S1.Cells(i, "E")
                    S3.Cells(sat, "J") = S1.Cells(i, "H")
                    S3.Cells(sat, "K") = S1.Cells(i, "I")
                    S3.Cells(sat, "L") = S1.Cells(i, "J")
                    S3.Cells(sat, "M") = S1.Cells(i, "K")
                    S3.Cells(sat, "T") = S2.Cells(j, "G")
                    S3.Cells(sat, "U") = S2.Cells(j, "F")
                    S3.Cells(sat, "V") = S2.Cells(j, "H")
                    S3.Cells(sat, "W") = S2.Cells(j, "I")
                    sat = sat + 1
                Next j
                For k = 3 To 13
                    If k < 8 Or k > 9 Then
                        S3.Cells(s, k).Resize(sat - s, 1).MergeCells = True
                        S3.Cells(s, k).Resize(sat - s, 1).VerticalAlignment = xlCenter
                    End If
                Next k
                s = 0
                S2.Cells(c.Row, "G").Replace "|", "", xlPart
            End If
        Else
            S3.Cells(sat, "C") = S1.Cells(i, "A")
            S3.Cells(sat, "D") = S1.Cells(i, "B")
            S3.Cells(sat, "E") = S1.Cells(i, "C")
            S3.Cells(sat, "H") = S1.Cells(i, "F")
            S3.Cells(sat, "I") = S1.Cells(i, "G")
            S3.Cells(sat, "F") = S1.Cells(i, "D")
            S3.Cells(sat, "G") = S1.Cells(i, "E")
            S3.Cells(sat, "J") = S1.Cells(i, "H")
            S3.Cells(sat, "K") = S1.Cells(i, "I")
            S3.Cells(sat, "L") = S1.Cells(i, "J")
            S3.Cells(sat, "M") = S1.Cells(i, "K")
            S3.Cells(sat, "T") = S1.Cells(i, "L")
            sat = sat + 1
        End If
        sat = sat + 1
    Next i

    S3.Select
    Range("A2:AD" & sat - 2).Borders.LineStyle = 1
    S2.[G:G].Replace "|", "", xlPart
    [T:T].Replace "|", "", xlPart

    MsgBox "Aktarım Tamamlandı.", vbInformation
    Application.DisplayAlerts = True
    Application.ScreenUpdating = True
   
End Sub
@Ömer bey çok teşekkür ederim elinize sağlık.
Örnek verileri çoğaltarak da denedim, problem gözükmemektedir şuan.
 

RBozkurt

𐱅𐰇𐰼𐰚
Altın Üye
Katılım
10 Ocak 2018
Mesajlar
681
Excel Vers. ve Dili
Microsoft Office 2024
Google Sheets
Altın Üyelik Bitiş Tarihi
19-12-2026
@Ömer bey merhaba.

3. mesajınızdaki kodlarda biraz değişikliğe gittim. Ekleme ve çıkarma işlemi gerçekleştirdim.

Kod:
Kod:
Sub D_On_Calisma_Olustur_Kolonlu()

    Dim S1 As Worksheet, S2 As Worksheet, S3 As Worksheet, son As Long
    Dim i As Long, c As Range, sat As Long, j As Long, s As Long, k As Integer

    Set S1 = Sheets("NetcadRapor")
    Set S2 = Sheets("MernisListe")
    Set S3 = Sheets("ÖnÇalışma")
    son = S2.Cells(Rows.Count, "G").End(xlUp).Row
 
    Application.ScreenUpdating = False
    Application.DisplayAlerts = False
    S3.Rows("2:" & Rows.Count).Clear
    
    sat = 2
    For i = 2 To S1.Cells(Rows.Count, "F").End(xlUp).Row
        Set c = S2.[G:G].Find(S1.Cells(i, "L"), , xlValues, xlWhole)
        If Not c Is Nothing And S1.Cells(i, "L") <> "" Then
            If Trim(S2.Cells(c.Row - 1, "G")) = "" Then
                For j = c.Row To son
                    If s = 0 Then s = sat
                    If Trim(S2.Cells(j, "G")) = "" Then
                        Exit For
                    End If
                    S2.Cells(j, "G") = S2.Cells(j, "G") & "|"
                    S3.Cells(sat, "C") = S1.Cells(i, "A") 'İL
                    S3.Cells(sat, "B") = S1.Cells(i, "N") 'KDN
                    S3.Cells(sat, "D") = S1.Cells(i, "B") 'İLÇE
                    S3.Cells(sat, "E") = S1.Cells(i, "C") 'MAHALLE
                    S3.Cells(sat, "H") = S2.Cells(j, "B") 'ADI SOYADI
                    S3.Cells(sat, "I") = S2.Cells(j, "C") 'BABA ADI
                    S3.Cells(sat, "F") = S1.Cells(i, "D") 'ADA
                    S3.Cells(sat, "G") = S1.Cells(i, "E") 'PARSEL
                    S3.Cells(sat, "J") = " " & S1.Cells(i, "H") & " / " & S1.Cells(i, "I") ' HİSSE PAY/HİSSE PAYDA
                    S3.Cells(sat, "K") = S1.Cells(i, "J") 'CİNS
                    S3.Cells(sat, "L") = S1.Cells(i, "K") 'YÜZ ÖLÇÜMÜ
                    S3.Cells(sat, "S") = S2.Cells(j, "G") 'TC NO
                    S3.Cells(sat, "T") = S2.Cells(j, "F") 'DOĞUM TARİHİ
                    S3.Cells(sat, "U") = S2.Cells(j, "H") 'ADRES
                    S3.Cells(sat, "V") = S2.Cells(j, "I") 'DURUM
                    S3.Cells(sat, "M") = S1.Cells(i, "O") 'İSTİMLAK ALANI
                    S3.Cells(sat, "N") = S1.Cells(i, "P") 'İRTİFAK ALANI
                    S3.Cells(sat, "P") = S1.Cells(i, "R") 'İSTİMLAK BEDELİ
                    S3.Cells(sat, "Q") = S1.Cells(i, "S") 'İRTİFAK BEDELİ
                    S3.Cells(sat, "R") = S1.Cells(i, "T") 'TOPLAM BEDEL
                    sat = sat + 1
                Next j
                For k = 1 To 19
                    If k < 8 Or k > 9 Then
                        S3.Cells(s, k).Resize(sat - s, 1).MergeCells = True
                        S3.Cells(s, k).Resize(sat - s, 1).VerticalAlignment = xlCenter 'DİKEY ORTALA
                        S3.Cells(s, k).Resize(sat - s, 1).HorizontalAlignment = xlCenter 'YATAY ORTALA
                    End If
                Next k
                s = 0
                S2.Cells(c.Row, "G").Replace "|", "", xlPart
            End If
        Else
            S3.Cells(sat, "C") = S1.Cells(i, "A") 'İL
            S3.Cells(sat, "B") = S1.Cells(i, "N") 'KDN
            S3.Cells(sat, "D") = S1.Cells(i, "B") 'İLÇE
            S3.Cells(sat, "E") = S1.Cells(i, "C") 'MAHALLE
            S3.Cells(sat, "H") = S1.Cells(i, "F") 'ADI SOYADI
            S3.Cells(sat, "I") = S1.Cells(i, "G") 'BABA ADI
            S3.Cells(sat, "F") = S1.Cells(i, "D") 'ADA
            S3.Cells(sat, "G") = S1.Cells(i, "E") 'PARSEL
            S3.Cells(sat, "J") = " " & S1.Cells(i, "H") & "/" & S1.Cells(i, "I") 'HİSSE PAY/HİSSE PAYDA
            S3.Cells(sat, "K") = S1.Cells(i, "J") 'CİNS
            S3.Cells(sat, "L") = S1.Cells(i, "K") 'YÜZ ÖLÇÜMÜ
            S3.Cells(sat, "S") = S1.Cells(i, "L") 'TC NO
            S3.Cells(sat, "M") = S1.Cells(i, "O") 'İSTİMLAK ALANI
            S3.Cells(sat, "N") = S1.Cells(i, "P") 'İRTİFAK ALANI
            S3.Cells(sat, "P") = S1.Cells(i, "R") 'İSTİMLAK BEDELİ
            S3.Cells(sat, "Q") = S1.Cells(i, "S") 'İRTİFAK BEDELİ
            S3.Cells(sat, "R") = S1.Cells(i, "T") 'TOPLAM BEDEL
            sat = sat + 1
        End If
        sat = sat + 1
    Next i
    
    S3.Select
    Range("A2:V" & sat - 2).Borders.LineStyle = 1 'A2:V KENARLIK & KOLON YAP
    S2.[G:G].Replace "|", "", xlPart
    [S:S].Replace "|", "", xlPart
    
    With Sayfa5.Range("A:G") 'A:G SÜTUNUNU YATAY & DİKEY ORTALA, GENİŞLİĞİ AYARLA
        .HorizontalAlignment = xlCenter
        .VerticalAlignment = xlCenter
        .EntireColumn.AutoFit
    End With
    
    With Sayfa5.Range("J:V") 'J:V SÜTUNUNU YATAY & DİKEY ORTALA, GENİŞLİĞİ AYARLA
        .HorizontalAlignment = xlCenter
        .VerticalAlignment = xlCenter
        .EntireColumn.AutoFit
    End With
    

    MsgBox "Aktarım Tamamlandı.", vbInformation
    Application.DisplayAlerts = True
    Application.ScreenUpdating = True
    
End Sub
1.
L, M, N ve P, Q, R sütunlarını yukarıdaki makro çalışınca 1234,56 "#,##0.00" şeklinde nasıl yapabilirim?

Adsız2.png

2.
O Sütununa
M > 0 ve N > 0 ise O=İstimlak + İrtifak
M = 0 ve N > 0 ise O=İrtifak
M > 0 ve N = 0 ise O=İstimlak yazdırmak istiyorum.

3.
Geçen gün çözülen husus referans alınarak;
MernisListe sayfasında TC yi arıyor, eğer bulunan TC numarasının varisleri var ise (yani kişi ölmüş ve varisi var) böyle olunca J sütunundaki veriye resimde sarı sütundaki gibi kelime eklemesi yapılabilir mi?

Adsız.png
 

Ekli dosyalar

RBozkurt

𐱅𐰇𐰼𐰚
Altın Üye
Katılım
10 Ocak 2018
Mesajlar
681
Excel Vers. ve Dili
Microsoft Office 2024
Google Sheets
Altın Üyelik Bitiş Tarihi
19-12-2026
Merhaba;


Mesaj 5'de bulunan kod ve dosya

For k = 1 To 19 olan satır gözden kaçmış. For k = 1 To 18 olarak güncelledim.

Kod:
Sub D_On_Calisma_Olustur_Kolonlu()

    Dim S1 As Worksheet, S2 As Worksheet, S3 As Worksheet, son As Long
    Dim i As Long, c As Range, sat As Long, j As Long, s As Long, k As Integer

    Set S1 = Sheets("NetcadRapor")
    Set S2 = Sheets("MernisListe")
    Set S3 = Sheets("ÖnÇalışma")
    son = S2.Cells(Rows.Count, "G").End(xlUp).Row
 
    Application.ScreenUpdating = False
    Application.DisplayAlerts = False
    S3.Rows("2:" & Rows.Count).Clear
    
    sat = 2
    For i = 2 To S1.Cells(Rows.Count, "F").End(xlUp).Row
        Set c = S2.[G:G].Find(S1.Cells(i, "L"), , xlValues, xlWhole)
        If Not c Is Nothing And S1.Cells(i, "L") <> "" Then
            If Trim(S2.Cells(c.Row - 1, "G")) = "" Then
                For j = c.Row To son
                    If s = 0 Then s = sat
                    If Trim(S2.Cells(j, "G")) = "" Then
                        Exit For
                    End If
                    S2.Cells(j, "G") = S2.Cells(j, "G") & "|"
                    S3.Cells(sat, "C") = S1.Cells(i, "A") 'İL
                    S3.Cells(sat, "B") = S1.Cells(i, "N") 'KDN
                    S3.Cells(sat, "D") = S1.Cells(i, "B") 'İLÇE
                    S3.Cells(sat, "E") = S1.Cells(i, "C") 'MAHALLE
                    S3.Cells(sat, "H") = S2.Cells(j, "B") 'ADI SOYADI
                    S3.Cells(sat, "I") = S2.Cells(j, "C") 'BABA ADI
                    S3.Cells(sat, "F") = S1.Cells(i, "D") 'ADA
                    S3.Cells(sat, "G") = S1.Cells(i, "E") 'PARSEL
                    S3.Cells(sat, "J") = " " & S1.Cells(i, "H") & " / " & S1.Cells(i, "I") ' HİSSE PAY/HİSSE PAYDA
                    S3.Cells(sat, "K") = S1.Cells(i, "J") 'CİNS
                    S3.Cells(sat, "L") = S1.Cells(i, "K") 'YÜZ ÖLÇÜMÜ
                    S3.Cells(sat, "S") = S2.Cells(j, "G") 'TC NO
                    S3.Cells(sat, "T") = S2.Cells(j, "F") 'DOĞUM TARİHİ
                    S3.Cells(sat, "U") = S2.Cells(j, "H") 'ADRES
                    S3.Cells(sat, "V") = S2.Cells(j, "I") 'DURUM
                    S3.Cells(sat, "M") = S1.Cells(i, "O") 'İSTİMLAK ALANI
                    S3.Cells(sat, "N") = S1.Cells(i, "P") 'İRTİFAK ALANI
                    S3.Cells(sat, "P") = S1.Cells(i, "R") 'İSTİMLAK BEDELİ
                    S3.Cells(sat, "Q") = S1.Cells(i, "S") 'İRTİFAK BEDELİ
                    S3.Cells(sat, "R") = S1.Cells(i, "T") 'TOPLAM BEDEL
                    sat = sat + 1
                Next j
                For k = 1 To 18
                    If k < 8 Or k > 9 Then
                        S3.Cells(s, k).Resize(sat - s, 1).MergeCells = True
                        S3.Cells(s, k).Resize(sat - s, 1).VerticalAlignment = xlCenter 'DİKEY ORTALA
                        S3.Cells(s, k).Resize(sat - s, 1).HorizontalAlignment = xlCenter 'YATAY ORTALA
                    End If
                Next k
                s = 0
                S2.Cells(c.Row, "G").Replace "|", "", xlPart
            End If
        Else
            S3.Cells(sat, "C") = S1.Cells(i, "A") 'İL
            S3.Cells(sat, "B") = S1.Cells(i, "N") 'KDN
            S3.Cells(sat, "D") = S1.Cells(i, "B") 'İLÇE
            S3.Cells(sat, "E") = S1.Cells(i, "C") 'MAHALLE
            S3.Cells(sat, "H") = S1.Cells(i, "F") 'ADI SOYADI
            S3.Cells(sat, "I") = S1.Cells(i, "G") 'BABA ADI
            S3.Cells(sat, "F") = S1.Cells(i, "D") 'ADA
            S3.Cells(sat, "G") = S1.Cells(i, "E") 'PARSEL
            S3.Cells(sat, "J") = " " & S1.Cells(i, "H") & "/" & S1.Cells(i, "I") 'HİSSE PAY/HİSSE PAYDA
            S3.Cells(sat, "K") = S1.Cells(i, "J") 'CİNS
            S3.Cells(sat, "L") = S1.Cells(i, "K") 'YÜZ ÖLÇÜMÜ
            S3.Cells(sat, "S") = S1.Cells(i, "L") 'TC NO
            S3.Cells(sat, "M") = S1.Cells(i, "O") 'İSTİMLAK ALANI
            S3.Cells(sat, "N") = S1.Cells(i, "P") 'İRTİFAK ALANI
            S3.Cells(sat, "P") = S1.Cells(i, "R") 'İSTİMLAK BEDELİ
            S3.Cells(sat, "Q") = S1.Cells(i, "S") 'İRTİFAK BEDELİ
            S3.Cells(sat, "R") = S1.Cells(i, "T") 'TOPLAM BEDEL
            sat = sat + 1
        End If
        sat = sat + 1
    Next i
    
    S3.Select
    Range("A2:V" & sat - 2).Borders.LineStyle = 1 'A2:V KENARLIK & KOLON YAP
    S2.[G:G].Replace "|", "", xlPart
    [S:S].Replace "|", "", xlPart
    
    With Sayfa5.Range("A:G") 'A:G SÜTUNUNU YATAY & DİKEY ORTALA, GENİŞLİĞİ AYARLA
        .HorizontalAlignment = xlCenter
        .VerticalAlignment = xlCenter
        .EntireColumn.AutoFit
    End With
    
    With Sayfa5.Range("J:V") 'J:V SÜTUNUNU YATAY & DİKEY ORTALA, GENİŞLİĞİ AYARLA
        .HorizontalAlignment = xlCenter
        .VerticalAlignment = xlCenter
        .EntireColumn.AutoFit
    End With
    

    MsgBox "Aktarım Tamamlandı.", vbInformation
    Application.DisplayAlerts = True
    Application.ScreenUpdating = True
    
End Sub
 

Ekli dosyalar

Ömer

Moderatör
Yönetici
Katılım
18 Ağustos 2007
Mesajlar
22,184
Excel Vers. ve Dili
Microsoft 365 Tr
Ofis 2016 Tr
Deneyiniz.
Kod:
Sub D_On_Calisma_Olustur_Kolonlu()

    Dim S1 As Worksheet, S2 As Worksheet, S3 As Worksheet, son As Long, a As Byte
    Dim i As Long, c As Range, sat As Long, j As Long, s As Long, k As Integer, deg As String

    Set S1 = Sheets("NetcadRapor")
    Set S2 = Sheets("MernisListe")
    Set S3 = Sheets("ÖnÇalışma")
    son = S2.Cells(Rows.Count, "G").End(xlUp).Row
 
    Application.ScreenUpdating = False
    Application.DisplayAlerts = False
    S3.Rows("2:" & Rows.Count).Clear
    
    sat = 2
    For i = 2 To S1.Cells(Rows.Count, "F").End(xlUp).Row
        Set c = S2.[G:G].Find(S1.Cells(i, "L"), , xlValues, xlWhole)
        If Not c Is Nothing And S1.Cells(i, "L") <> "" Then
            If Trim(S2.Cells(c.Row - 1, "G")) = "" Then
                For j = c.Row To son
                    If s = 0 Then s = sat
                    If Trim(S2.Cells(j, "G")) = "" Then
                        Exit For
                    End If
                    S2.Cells(j, "G") = S2.Cells(j, "G") & "|"
                    S3.Cells(sat, "C") = S1.Cells(i, "A") 'İL
                    S3.Cells(sat, "B") = S1.Cells(i, "N") 'KDN
                    S3.Cells(sat, "D") = S1.Cells(i, "B") 'İLÇE
                    S3.Cells(sat, "E") = S1.Cells(i, "C") 'MAHALLE
                    S3.Cells(sat, "H") = S2.Cells(j, "B") 'ADI SOYADI
                    S3.Cells(sat, "I") = S2.Cells(j, "C") 'BABA ADI
                    S3.Cells(sat, "F") = S1.Cells(i, "D") 'ADA
                    S3.Cells(sat, "G") = S1.Cells(i, "E") 'PARSEL
                    S3.Cells(sat, "J") = " " & S1.Cells(i, "H") & " / " & S1.Cells(i, "I") & " (Vers.İşlm.)" ' HİSSE PAY/HİSSE PAYDA
                    S3.Cells(sat, "K") = S1.Cells(i, "J")  'CİNS
                    S3.Cells(sat, "L") = S1.Cells(i, "K") 'YÜZ ÖLÇÜMÜ
                    S3.Cells(sat, "S") = S2.Cells(j, "G") 'TC NO
                    S3.Cells(sat, "T") = S2.Cells(j, "F") 'DOĞUM TARİHİ
                    S3.Cells(sat, "U") = S2.Cells(j, "H") 'ADRES
                    S3.Cells(sat, "V") = S2.Cells(j, "I") 'DURUM
                    S3.Cells(sat, "M") = S1.Cells(i, "O") 'İSTİMLAK ALANI
                    S3.Cells(sat, "N") = S1.Cells(i, "P") 'İRTİFAK ALANI
                    S3.Cells(sat, "P") = S1.Cells(i, "R") 'İSTİMLAK BEDELİ
                    S3.Cells(sat, "Q") = S1.Cells(i, "S") 'İRTİFAK BEDELİ
                    S3.Cells(sat, "R") = S1.Cells(i, "T") 'TOPLAM BEDEL
                    If S3.Cells(sat, "M") > 0 And S3.Cells(sat, "N") > 0 Then
                        S3.Cells(sat, "O") = "İstimlak + İrtifak"
                    ElseIf S3.Cells(sat, "M") = 0 And S3.Cells(sat, "N") > 0 Then
                        S3.Cells(sat, "O") = "İrtifak"
                    ElseIf S3.Cells(sat, "M") > 0 And S3.Cells(sat, "N") = 0 Then
                        S3.Cells(sat, "O") = "İstimlak"
                    End If
                    a = a + 1
                    sat = sat + 1
                Next j
                If a = 1 Then
                    S3.Cells(sat - 1, "J").Replace " (Vers.İşlm.)", "", xlPart
                End If
                If a > 1 Then
                    For k = 1 To 18
                        If k < 8 Or k > 9 Then
                            S3.Cells(s, k).Resize(sat - s, 1).MergeCells = True
                            S3.Cells(s, k).Resize(sat - s, 1).VerticalAlignment = xlCenter 'DİKEY ORTALA
                            S3.Cells(s, k).Resize(sat - s, 1).HorizontalAlignment = xlCenter 'YATAY ORTALA
                        End If
                    Next k
                End If
                a = 0
                s = 0
                S2.Cells(c.Row, "G").Replace "|", "", xlPart
            End If
        Else
            S3.Cells(sat, "C") = S1.Cells(i, "A") 'İL
            S3.Cells(sat, "B") = S1.Cells(i, "N") 'KDN
            S3.Cells(sat, "D") = S1.Cells(i, "B") 'İLÇE
            S3.Cells(sat, "E") = S1.Cells(i, "C") 'MAHALLE
            S3.Cells(sat, "H") = S1.Cells(i, "F") 'ADI SOYADI
            S3.Cells(sat, "I") = S1.Cells(i, "G") 'BABA ADI
            S3.Cells(sat, "F") = S1.Cells(i, "D") 'ADA
            S3.Cells(sat, "G") = S1.Cells(i, "E") 'PARSEL
            S3.Cells(sat, "J") = " " & S1.Cells(i, "H") & "/" & S1.Cells(i, "I") 'HİSSE PAY/HİSSE PAYDA
            S3.Cells(sat, "K") = S1.Cells(i, "J") 'CİNS
            S3.Cells(sat, "L") = S1.Cells(i, "K") 'YÜZ ÖLÇÜMÜ
            S3.Cells(sat, "S") = S1.Cells(i, "L") 'TC NO
            S3.Cells(sat, "M") = S1.Cells(i, "O") 'İSTİMLAK ALANI
            S3.Cells(sat, "N") = S1.Cells(i, "P") 'İRTİFAK ALANI
            S3.Cells(sat, "P") = S1.Cells(i, "R") 'İSTİMLAK BEDELİ
            S3.Cells(sat, "Q") = S1.Cells(i, "S") 'İRTİFAK BEDELİ
            S3.Cells(sat, "R") = S1.Cells(i, "T") 'TOPLAM BEDEL
            If S3.Cells(sat, "M") > 0 And S3.Cells(sat, "N") > 0 Then
                S3.Cells(sat, "O") = "İstimlak + İrtifak"
            ElseIf S3.Cells(sat, "M") = 0 And S3.Cells(sat, "N") > 0 Then
                S3.Cells(sat, "O") = "İrtifak"
            ElseIf S3.Cells(sat, "M") > 0 And S3.Cells(sat, "N") = 0 Then
                S3.Cells(sat, "O") = "İstimlak"
            End If
            sat = sat + 1
        End If
        sat = sat + 1
    Next i
    
    S3.Select
    Range("A2:V" & sat - 2).Borders.LineStyle = 1 'A2:V KENARLIK & KOLON YAP
    S2.[G:G].Replace "|", "", xlPart
    [S:S].Replace "|", "", xlPart
    [L:M].NumberFormat = "#,##0.00"
    [P:Q].NumberFormat = "#,##0.00"
    
    With Sayfa5.Range("A:G") 'A:G SÜTUNUNU YATAY & DİKEY ORTALA, GENİŞLİĞİ AYARLA
        .HorizontalAlignment = xlCenter
        .VerticalAlignment = xlCenter
        .EntireColumn.AutoFit
    End With
    
    With Sayfa5.Range("J:V") 'J:V SÜTUNUNU YATAY & DİKEY ORTALA, GENİŞLİĞİ AYARLA
        .HorizontalAlignment = xlCenter
        .VerticalAlignment = xlCenter
        .EntireColumn.AutoFit
    End With
    

    MsgBox "Aktarım Tamamlandı.", vbInformation
    Application.DisplayAlerts = True
    Application.ScreenUpdating = True
    
End Sub
 

RBozkurt

𐱅𐰇𐰼𐰚
Altın Üye
Katılım
10 Ocak 2018
Mesajlar
681
Excel Vers. ve Dili
Microsoft Office 2024
Google Sheets
Altın Üyelik Bitiş Tarihi
19-12-2026
@Ömer abi gerçekten tek kelimeyle mükemmel olmuş.

Sadece [L:M].NumberFormat = "#,##0.00" satırını [L:N].NumberFormat = "#,##0.00" olarak güncelledim.
 

RBozkurt

𐱅𐰇𐰼𐰚
Altın Üye
Katılım
10 Ocak 2018
Mesajlar
681
Excel Vers. ve Dili
Microsoft Office 2024
Google Sheets
Altın Üyelik Bitiş Tarihi
19-12-2026
Deneyiniz.

Kod:
Sub D_On_Calisma_Olustur_Kolonlu()

    Dim S1 As Worksheet, S2 As Worksheet, S3 As Worksheet, son As Long, a As Byte
    Dim i As Long, c As Range, sat As Long, j As Long, s As Long, k As Integer, deg As String

    Set S1 = Sheets("NetcadRapor")
    Set S2 = Sheets("MernisListe")
    Set S3 = Sheets("ÖnÇalışma")
    son = S2.Cells(Rows.Count, "G").End(xlUp).Row

    Application.ScreenUpdating = False
    Application.DisplayAlerts = False
    S3.Rows("2:" & Rows.Count).Clear
   
    sat = 2
    For i = 2 To S1.Cells(Rows.Count, "F").End(xlUp).Row
        Set c = S2.[G:G].Find(S1.Cells(i, "L"), , xlValues, xlWhole)
        If Not c Is Nothing And S1.Cells(i, "L") <> "" Then
            If Trim(S2.Cells(c.Row - 1, "G")) = "" Then
                For j = c.Row To son
                    If s = 0 Then s = sat
                    If Trim(S2.Cells(j, "G")) = "" Then
                        Exit For
                    End If
                    S2.Cells(j, "G") = S2.Cells(j, "G") & "|"
                    S3.Cells(sat, "C") = S1.Cells(i, "A") 'İL
                    S3.Cells(sat, "B") = S1.Cells(i, "N") 'KDN
                    S3.Cells(sat, "D") = S1.Cells(i, "B") 'İLÇE
                    S3.Cells(sat, "E") = S1.Cells(i, "C") 'MAHALLE
                    S3.Cells(sat, "H") = S2.Cells(j, "B") 'ADI SOYADI
                    S3.Cells(sat, "I") = S2.Cells(j, "C") 'BABA ADI
                    S3.Cells(sat, "F") = S1.Cells(i, "D") 'ADA
                    S3.Cells(sat, "G") = S1.Cells(i, "E") 'PARSEL
                    S3.Cells(sat, "J") = " " & S1.Cells(i, "H") & " / " & S1.Cells(i, "I") & " (Vers.İşlm.)" ' HİSSE PAY/HİSSE PAYDA
                    S3.Cells(sat, "K") = S1.Cells(i, "J")  'CİNS
                    S3.Cells(sat, "L") = S1.Cells(i, "K") 'YÜZ ÖLÇÜMÜ
                    S3.Cells(sat, "S") = S2.Cells(j, "G") 'TC NO
                    S3.Cells(sat, "T") = S2.Cells(j, "F") 'DOĞUM TARİHİ
                    S3.Cells(sat, "U") = S2.Cells(j, "H") 'ADRES
                    S3.Cells(sat, "V") = S2.Cells(j, "I") 'DURUM
                    S3.Cells(sat, "M") = S1.Cells(i, "O") 'İSTİMLAK ALANI
                    S3.Cells(sat, "N") = S1.Cells(i, "P") 'İRTİFAK ALANI
                    S3.Cells(sat, "P") = S1.Cells(i, "R") 'İSTİMLAK BEDELİ
                    S3.Cells(sat, "Q") = S1.Cells(i, "S") 'İRTİFAK BEDELİ
                    S3.Cells(sat, "R") = S1.Cells(i, "T") 'TOPLAM BEDEL
                    If S3.Cells(sat, "M") > 0 And S3.Cells(sat, "N") > 0 Then
                        S3.Cells(sat, "O") = "İstimlak + İrtifak"
                    ElseIf S3.Cells(sat, "M") = 0 And S3.Cells(sat, "N") > 0 Then
                        S3.Cells(sat, "O") = "İrtifak"
                    ElseIf S3.Cells(sat, "M") > 0 And S3.Cells(sat, "N") = 0 Then
                        S3.Cells(sat, "O") = "İstimlak"
                    End If
                    a = a + 1
                    sat = sat + 1
                Next j
                If a = 1 Then
                    S3.Cells(sat - 1, "J").Replace " (Vers.İşlm.)", "", xlPart
                End If
                If a > 1 Then
                    For k = 1 To 18
                        If k < 8 Or k > 9 Then
                            S3.Cells(s, k).Resize(sat - s, 1).MergeCells = True
                            S3.Cells(s, k).Resize(sat - s, 1).VerticalAlignment = xlCenter 'DİKEY ORTALA
                            S3.Cells(s, k).Resize(sat - s, 1).HorizontalAlignment = xlCenter 'YATAY ORTALA
                        End If
                    Next k
                End If
                a = 0
                s = 0
                S2.Cells(c.Row, "G").Replace "|", "", xlPart
            End If
        Else
            S3.Cells(sat, "C") = S1.Cells(i, "A") 'İL
            S3.Cells(sat, "B") = S1.Cells(i, "N") 'KDN
            S3.Cells(sat, "D") = S1.Cells(i, "B") 'İLÇE
            S3.Cells(sat, "E") = S1.Cells(i, "C") 'MAHALLE
            S3.Cells(sat, "H") = S1.Cells(i, "F") 'ADI SOYADI
            S3.Cells(sat, "I") = S1.Cells(i, "G") 'BABA ADI
            S3.Cells(sat, "F") = S1.Cells(i, "D") 'ADA
            S3.Cells(sat, "G") = S1.Cells(i, "E") 'PARSEL
            S3.Cells(sat, "J") = " " & S1.Cells(i, "H") & "/" & S1.Cells(i, "I") 'HİSSE PAY/HİSSE PAYDA
            S3.Cells(sat, "K") = S1.Cells(i, "J") 'CİNS
            S3.Cells(sat, "L") = S1.Cells(i, "K") 'YÜZ ÖLÇÜMÜ
            S3.Cells(sat, "S") = S1.Cells(i, "L") 'TC NO
            S3.Cells(sat, "M") = S1.Cells(i, "O") 'İSTİMLAK ALANI
            S3.Cells(sat, "N") = S1.Cells(i, "P") 'İRTİFAK ALANI
            S3.Cells(sat, "P") = S1.Cells(i, "R") 'İSTİMLAK BEDELİ
            S3.Cells(sat, "Q") = S1.Cells(i, "S") 'İRTİFAK BEDELİ
            S3.Cells(sat, "R") = S1.Cells(i, "T") 'TOPLAM BEDEL
            If S3.Cells(sat, "M") > 0 And S3.Cells(sat, "N") > 0 Then
                S3.Cells(sat, "O") = "İstimlak + İrtifak"
            ElseIf S3.Cells(sat, "M") = 0 And S3.Cells(sat, "N") > 0 Then
                S3.Cells(sat, "O") = "İrtifak"
            ElseIf S3.Cells(sat, "M") > 0 And S3.Cells(sat, "N") = 0 Then
                S3.Cells(sat, "O") = "İstimlak"
            End If
            sat = sat + 1
        End If
        sat = sat + 1
    Next i
   
    S3.Select
    Range("A2:V" & sat - 2).Borders.LineStyle = 1 'A2:V KENARLIK & KOLON YAP
    S2.[G:G].Replace "|", "", xlPart
    [S:S].Replace "|", "", xlPart
    [L:M].NumberFormat = "#,##0.00"
    [P:Q].NumberFormat = "#,##0.00"
   
    With Sayfa5.Range("A:G") 'A:G SÜTUNUNU YATAY & DİKEY ORTALA, GENİŞLİĞİ AYARLA
        .HorizontalAlignment = xlCenter
        .VerticalAlignment = xlCenter
        .EntireColumn.AutoFit
    End With
   
    With Sayfa5.Range("J:V") 'J:V SÜTUNUNU YATAY & DİKEY ORTALA, GENİŞLİĞİ AYARLA
        .HorizontalAlignment = xlCenter
        .VerticalAlignment = xlCenter
        .EntireColumn.AutoFit
    End With
   

    MsgBox "Aktarım Tamamlandı.", vbInformation
    Application.DisplayAlerts = True
    Application.ScreenUpdating = True
   
End Sub
@Ömer abi merhaba. Üstteki kodun içerisine B sütununda veri var ise A sütununa sıra numarası verilmesi eklenebilir mi?
B'deki değerlerin sistematik bir sırası yok mesela 12den de başlayabilir. B'de bulunan değerin sırasına göre A'ya sıra ataması gibi.
Yani B de benzersiz 10 değer var. A'daki en son numaramız 10.

A​

B​

1​

1​

2​

3​

2​

3​

3​

4​

4​

5​

4​

5​

5​

6​

6​

8​

7​

11​


8​

14​

8​

14​

8​

14​

9​

15​

10​

16​

10​

16​

 

RBozkurt

𐱅𐰇𐰼𐰚
Altın Üye
Katılım
10 Ocak 2018
Mesajlar
681
Excel Vers. ve Dili
Microsoft Office 2024
Google Sheets
Altın Üyelik Bitiş Tarihi
19-12-2026
Merhaba.
Sayfa içerisinde 2. bir makro kullanıyordum ordan hallettim. Teşekkür ederim.
 

RBozkurt

𐱅𐰇𐰼𐰚
Altın Üye
Katılım
10 Ocak 2018
Mesajlar
681
Excel Vers. ve Dili
Microsoft Office 2024
Google Sheets
Altın Üyelik Bitiş Tarihi
19-12-2026
Merhaba
Yukarıdaki 7. mesaj içeriğinde bulunan makrodan alıntı olarak;

Alttaki kod;
S1 sayfasındaki L'de bulunan değeri, S2 sayfasında G sütununda arıyor ve altında veri var ise veri ile birlikte veri yoksa tek o satırı kopyalıyordu.

Kod içerisinden neyi değiştirirsem;
S1 sayfasındaki L'de bulunan değeri, S2 sayfasında G sütununda arayıp sadece o satıra ait verileri alır?
Yani altındaki satırlardan veri çekme işlemini iptal ederim?

Makroyu 3 farklı sayfaya revizyon yapıyorum. Orj kullandığım sayfada hata yoktur. Çok güzel çalışıyor.
Diğer sayfa için sadece aranan TC ye ait verilerin gelmesi gerekli.
Teşekkür ederim.

C++:
    sat = 2
    For i = 2 To S1.Cells(Rows.Count, "F").End(xlUp).Row
        Set c = S2.[G:G].Find(S1.Cells(i, "L"), , xlValues, xlWhole)
        If Not c Is Nothing And S1.Cells(i, "L") <> "" Then
            If Trim(S2.Cells(c.Row - 1, "G")) = "" Then
                For j = c.Row To son
                    If s = 0 Then s = sat
                    If Trim(S2.Cells(j, "G")) = "" Then
                        Exit For
                    End If
 

Ömer

Moderatör
Yönetici
Katılım
18 Ağustos 2007
Mesajlar
22,184
Excel Vers. ve Dili
Microsoft 365 Tr
Ofis 2016 Tr
Yapı karışık olduğu için aklımda kaldığı kadarıyla değiştirmeye çalıştım. Hata varsa yazarsınız.
Kod:
Sub D_Kaynak1_Olustur()

    Dim S1 As Worksheet, S2 As Worksheet, S3 As Worksheet, son As Long, a As Byte
    Dim i As Long, c As Range, sat As Long, j As Long, s As Long, k As Integer, deg As String

    Set S1 = Sheets("NetcadRapor")
    Set S2 = Sheets("MernisListe")
    Set S3 = Sheets("Kaynak1")
    son = S2.Cells(Rows.Count, "G").End(xlUp).Row
 
    Application.ScreenUpdating = False
    Application.DisplayAlerts = False
    S3.Rows("2:" & Rows.Count).Clear
    
    sat = 2
    For i = 2 To S1.Cells(Rows.Count, "F").End(xlUp).Row
        Set c = S2.[G:G].Find(S1.Cells(i, "L"), , xlValues, xlWhole)
        If Not c Is Nothing And S1.Cells(i, "L") <> "" Then
            'Alttaki kodlar aktif olursa eğer varisler çekilir.
            'If Trim(S2.Cells(c.Row - 1, "G")) = "" Then
                'For j = c.Row To son
                    'If s = 0 Then s = sat
                    'If Trim(S2.Cells(j, "G")) = "" Then
                        'Exit For
                    'End If
                    S2.Cells(c.Row, "G") = S2.Cells(c.Row, "G") & "|"
                    S3.Cells(sat, "C") = S1.Cells(i, "A") 'İL
                    S3.Cells(sat, "B") = S1.Cells(i, "N") 'KDN
                    S3.Cells(sat, "D") = S1.Cells(i, "B") 'İLÇE
                    S3.Cells(sat, "E") = S1.Cells(i, "C") 'MAHALLE
                    S3.Cells(sat, "H") = S2.Cells(c.Row, "B") 'ADI SOYADI
                    S3.Cells(sat, "I") = S2.Cells(c.Row, "C") 'BABA ADI
                    S3.Cells(sat, "F") = S1.Cells(i, "D") 'ADA
                    S3.Cells(sat, "G") = S1.Cells(i, "E") 'PARSEL
                    S3.Cells(sat, "J") = " " & S1.Cells(i, "H") & " / " & S1.Cells(i, "I") & " (Vers.İşlm.)" ' HİSSE PAY/HİSSE PAYDA
                    S3.Cells(sat, "K") = S1.Cells(i, "J")  'CİNS
                    S3.Cells(sat, "L") = S1.Cells(i, "K") 'YÜZ ÖLÇÜMÜ
                    S3.Cells(sat, "S") = S2.Cells(c.Row, "G") 'TC NO
                    S3.Cells(sat, "T") = S2.Cells(c.Row, "F") 'DOĞUM TARİHİ
                    S3.Cells(sat, "U") = S2.Cells(c.Row, "H") 'ADRES
                    S3.Cells(sat, "V") = S2.Cells(c.Row, "I") 'DURUM
                    S3.Cells(sat, "M") = S1.Cells(i, "O") 'İSTİMLAK ALANI
                    S3.Cells(sat, "N") = S1.Cells(i, "P") 'İRTİFAK ALANI
                    S3.Cells(sat, "P") = S1.Cells(i, "R") 'İSTİMLAK BEDELİ
                    S3.Cells(sat, "Q") = S1.Cells(i, "S") 'İRTİFAK BEDELİ
                    S3.Cells(sat, "R") = S1.Cells(i, "T") 'TOPLAM BEDEL
                    If S3.Cells(sat, "M") > 0 And S3.Cells(sat, "N") > 0 Then
                        S3.Cells(sat, "O") = "İstimlak + İrtifak"
                    ElseIf S3.Cells(sat, "M") = 0 And S3.Cells(sat, "N") > 0 Then
                        S3.Cells(sat, "O") = "İrtifak"
                    ElseIf S3.Cells(sat, "M") > 0 And S3.Cells(sat, "N") = 0 Then
                        S3.Cells(sat, "O") = "İstimlak"
                    End If
                    a = a + 1
                    sat = sat + 1
                'Next j
                If a = 1 Then
                    S3.Cells(sat - 1, "J").Replace " (Vers.İşlm.)", "", xlPart
                End If
                If a > 1 Then
                    For k = 1 To 18
                        If k < 8 Or k > 9 Then
                            S3.Cells(s, k).Resize(sat - s, 1).MergeCells = True
                            S3.Cells(s, k).Resize(sat - s, 1).VerticalAlignment = xlCenter 'DİKEY ORTALA
                            S3.Cells(s, k).Resize(sat - s, 1).HorizontalAlignment = xlCenter 'YATAY ORTALA
                        End If
                    Next k
                End If
                a = 0
                s = 0
                S2.Cells(c.Row, "G").Replace "|", "", xlPart
            'End If
        Else
            S3.Cells(sat, "C") = S1.Cells(i, "A") 'İL
            S3.Cells(sat, "B") = S1.Cells(i, "N") 'KDN
            S3.Cells(sat, "D") = S1.Cells(i, "B") 'İLÇE
            S3.Cells(sat, "E") = S1.Cells(i, "C") 'MAHALLE
            S3.Cells(sat, "H") = S1.Cells(i, "F") 'ADI SOYADI
            S3.Cells(sat, "I") = S1.Cells(i, "G") 'BABA ADI
            S3.Cells(sat, "F") = S1.Cells(i, "D") 'ADA
            S3.Cells(sat, "G") = S1.Cells(i, "E") 'PARSEL
            S3.Cells(sat, "J") = " " & S1.Cells(i, "H") & "/" & S1.Cells(i, "I") 'HİSSE PAY/HİSSE PAYDA
            S3.Cells(sat, "K") = S1.Cells(i, "J") 'CİNS
            S3.Cells(sat, "L") = S1.Cells(i, "K") 'YÜZ ÖLÇÜMÜ
            S3.Cells(sat, "S") = S1.Cells(i, "L") 'TC NO
            S3.Cells(sat, "M") = S1.Cells(i, "O") 'İSTİMLAK ALANI
            S3.Cells(sat, "N") = S1.Cells(i, "P") 'İRTİFAK ALANI
            S3.Cells(sat, "P") = S1.Cells(i, "R") 'İSTİMLAK BEDELİ
            S3.Cells(sat, "Q") = S1.Cells(i, "S") 'İRTİFAK BEDELİ
            S3.Cells(sat, "R") = S1.Cells(i, "T") 'TOPLAM BEDEL
            If S3.Cells(sat, "M") > 0 And S3.Cells(sat, "N") > 0 Then
                S3.Cells(sat, "O") = "İstimlak + İrtifak"
            ElseIf S3.Cells(sat, "M") = 0 And S3.Cells(sat, "N") > 0 Then
                S3.Cells(sat, "O") = "İrtifak"
            ElseIf S3.Cells(sat, "M") > 0 And S3.Cells(sat, "N") = 0 Then
                S3.Cells(sat, "O") = "İstimlak"
            End If
            sat = sat + 1
        End If
        sat = sat + 1
    Next i
    
    S3.Select
    Range("A2:V" & sat - 2).Borders.LineStyle = 1 'A2:V KENARLIK & KOLON YAP
    S2.[G:G].Replace "|", "", xlPart
    [S:S].Replace "|", "", xlPart
    [L:N].NumberFormat = "#,##0.00"
    [P:Q].NumberFormat = "#,##0.00"
    
    With Sayfa6.Range("A:G") 'A:G SÜTUNUNU YATAY & DİKEY ORTALA, GENİŞLİĞİ AYARLA
        .HorizontalAlignment = xlCenter
        .VerticalAlignment = xlCenter
        .EntireColumn.AutoFit
    End With
    
    With Sayfa6.Range("J:V") 'J:V SÜTUNUNU YATAY & DİKEY ORTALA, GENİŞLİĞİ AYARLA
        .HorizontalAlignment = xlCenter
        .VerticalAlignment = xlCenter
        .EntireColumn.AutoFit
    End With
    

    MsgBox "Aktarım Tamamlandı.", vbInformation
    Application.DisplayAlerts = True
    Application.ScreenUpdating = True
    
End Sub
 

RBozkurt

𐱅𐰇𐰼𐰚
Altın Üye
Katılım
10 Ocak 2018
Mesajlar
681
Excel Vers. ve Dili
Microsoft Office 2024
Google Sheets
Altın Üyelik Bitiş Tarihi
19-12-2026
Yapı karışık olduğu için aklımda kaldığı kadarıyla değiştirmeye çalıştım. Hata varsa yazarsınız.
Kod:
Sub D_On_Calisma_Olustur_Kolonlu()

    Dim S1 As Worksheet, S2 As Worksheet, S3 As Worksheet, son As Long, a As Byte
    Dim i As Long, c As Range, sat As Long, j As Long, s As Long, k As Integer, deg As String

    Set S1 = Sheets("NetcadRapor")
    Set S2 = Sheets("MernisListe")
    Set S3 = Sheets("ÖnÇalışma")
    son = S2.Cells(Rows.Count, "G").End(xlUp).Row

    Application.ScreenUpdating = False
    Application.DisplayAlerts = False
    S3.Rows("2:" & Rows.Count).Clear
   
    sat = 2
    For i = 2 To S1.Cells(Rows.Count, "F").End(xlUp).Row
        Set c = S2.[G:G].Find(S1.Cells(i, "L"), , xlValues, xlWhole)
        If Not c Is Nothing And S1.Cells(i, "L") <> "" Then
            'If Trim(S2.Cells(c.Row - 1, "G")) = "" Then
                'For j = c.Row To son
                    'If s = 0 Then s = sat
                    'If Trim(S2.Cells(j, "G")) = "" Then
                        'Exit For
                    'End If
                    S2.Cells(c.Row, "G") = S2.Cells(c.Row, "G") & "|"
                    S3.Cells(sat, "C") = S1.Cells(i, "A") 'İL
                    S3.Cells(sat, "B") = S1.Cells(i, "N") 'KDN
                    S3.Cells(sat, "D") = S1.Cells(i, "B") 'İLÇE
                    S3.Cells(sat, "E") = S1.Cells(i, "C") 'MAHALLE
                    S3.Cells(sat, "H") = S2.Cells(c.Row, "B") 'ADI SOYADI
                    S3.Cells(sat, "I") = S2.Cells(c.Row, "C") 'BABA ADI
                    S3.Cells(sat, "F") = S1.Cells(i, "D") 'ADA
                    S3.Cells(sat, "G") = S1.Cells(i, "E") 'PARSEL
                    S3.Cells(sat, "J") = " " & S1.Cells(i, "H") & " / " & S1.Cells(i, "I") & " (Vers.İşlm.)" ' HİSSE PAY/HİSSE PAYDA
                    S3.Cells(sat, "K") = S1.Cells(i, "J")  'CİNS
                    S3.Cells(sat, "L") = S1.Cells(i, "K") 'YÜZ ÖLÇÜMÜ
                    S3.Cells(sat, "S") = S2.Cells(c.Row, "G") 'TC NO
                    S3.Cells(sat, "T") = S2.Cells(c.Row, "F") 'DOĞUM TARİHİ
                    S3.Cells(sat, "U") = S2.Cells(c.Row, "H") 'ADRES
                    S3.Cells(sat, "V") = S2.Cells(c.Row, "I") 'DURUM
                    S3.Cells(sat, "M") = S1.Cells(c.Row, "O") 'İSTİMLAK ALANI
                    S3.Cells(sat, "N") = S1.Cells(c.Row, "P") 'İRTİFAK ALANI
                    S3.Cells(sat, "P") = S1.Cells(c.Row, "R") 'İSTİMLAK BEDELİ
                    S3.Cells(sat, "Q") = S1.Cells(c.Row, "S") 'İRTİFAK BEDELİ
                    S3.Cells(sat, "R") = S1.Cells(c.Row, "T") 'TOPLAM BEDEL
                    If S3.Cells(sat, "M") > 0 And S3.Cells(sat, "N") > 0 Then
                        S3.Cells(sat, "O") = "İstimlak + İrtifak"
                    ElseIf S3.Cells(sat, "M") = 0 And S3.Cells(sat, "N") > 0 Then
                        S3.Cells(sat, "O") = "İrtifak"
                    ElseIf S3.Cells(sat, "M") > 0 And S3.Cells(sat, "N") = 0 Then
                        S3.Cells(sat, "O") = "İstimlak"
                    End If
                    a = a + 1
                    sat = sat + 1
                'Next j
                If a = 1 Then
                    S3.Cells(sat - 1, "J").Replace " (Vers.İşlm.)", "", xlPart
                End If
                If a > 1 Then
                    For k = 1 To 18
                        If k < 8 Or k > 9 Then
                            S3.Cells(s, k).Resize(sat - s, 1).MergeCells = True
                            S3.Cells(s, k).Resize(sat - s, 1).VerticalAlignment = xlCenter 'DİKEY ORTALA
                            S3.Cells(s, k).Resize(sat - s, 1).HorizontalAlignment = xlCenter 'YATAY ORTALA
                        End If
                    Next k
                End If
                a = 0
                s = 0
                S2.Cells(c.Row, "G").Replace "|", "", xlPart
            'End If
        Else
            S3.Cells(sat, "C") = S1.Cells(i, "A") 'İL
            S3.Cells(sat, "B") = S1.Cells(i, "N") 'KDN
            S3.Cells(sat, "D") = S1.Cells(i, "B") 'İLÇE
            S3.Cells(sat, "E") = S1.Cells(i, "C") 'MAHALLE
            S3.Cells(sat, "H") = S1.Cells(i, "F") 'ADI SOYADI
            S3.Cells(sat, "I") = S1.Cells(i, "G") 'BABA ADI
            S3.Cells(sat, "F") = S1.Cells(i, "D") 'ADA
            S3.Cells(sat, "G") = S1.Cells(i, "E") 'PARSEL
            S3.Cells(sat, "J") = " " & S1.Cells(i, "H") & "/" & S1.Cells(i, "I") 'HİSSE PAY/HİSSE PAYDA
            S3.Cells(sat, "K") = S1.Cells(i, "J") 'CİNS
            S3.Cells(sat, "L") = S1.Cells(i, "K") 'YÜZ ÖLÇÜMÜ
            S3.Cells(sat, "S") = S1.Cells(i, "L") 'TC NO
            S3.Cells(sat, "M") = S1.Cells(i, "O") 'İSTİMLAK ALANI
            S3.Cells(sat, "N") = S1.Cells(i, "P") 'İRTİFAK ALANI
            S3.Cells(sat, "P") = S1.Cells(i, "R") 'İSTİMLAK BEDELİ
            S3.Cells(sat, "Q") = S1.Cells(i, "S") 'İRTİFAK BEDELİ
            S3.Cells(sat, "R") = S1.Cells(i, "T") 'TOPLAM BEDEL
            If S3.Cells(sat, "M") > 0 And S3.Cells(sat, "N") > 0 Then
                S3.Cells(sat, "O") = "İstimlak + İrtifak"
            ElseIf S3.Cells(sat, "M") = 0 And S3.Cells(sat, "N") > 0 Then
                S3.Cells(sat, "O") = "İrtifak"
            ElseIf S3.Cells(sat, "M") > 0 And S3.Cells(sat, "N") = 0 Then
                S3.Cells(sat, "O") = "İstimlak"
            End If
            sat = sat + 1
        End If
        sat = sat + 1
    Next i
   
    S3.Select
    Range("A2:V" & sat - 2).Borders.LineStyle = 1 'A2:V KENARLIK & KOLON YAP
    S2.[G:G].Replace "|", "", xlPart
    [S:S].Replace "|", "", xlPart
    [L:N].NumberFormat = "#,##0.00"
    [P:Q].NumberFormat = "#,##0.00"
   
    With Sayfa5.Range("A:G") 'A:G SÜTUNUNU YATAY & DİKEY ORTALA, GENİŞLİĞİ AYARLA
        .HorizontalAlignment = xlCenter
        .VerticalAlignment = xlCenter
        .EntireColumn.AutoFit
    End With
   
    With Sayfa5.Range("J:V") 'J:V SÜTUNUNU YATAY & DİKEY ORTALA, GENİŞLİĞİ AYARLA
        .HorizontalAlignment = xlCenter
        .VerticalAlignment = xlCenter
        .EntireColumn.AutoFit
    End With
   

    MsgBox "Aktarım Tamamlandı.", vbInformation
    Application.DisplayAlerts = True
    Application.ScreenUpdating = True
   
End Sub
@Ömer ustam kodu farklı bir sayfaya uyarladım.
Anasayfada butona tıklayın.

Kaynak1 sayfasında M, N, O, P, Q, R sütunları eksik veri çekiyor
yaklaşık 2500 satırlık veri ile denedim. Ara ara eksik örnekteki gibi.
Sistematik bir eksiklikde değil anlamadım neden yaptığını.
Müsait olduğunuz zaman bakabilirseniz mutlu olurum.
 

Ekli dosyalar

Ömer

Moderatör
Yönetici
Katılım
18 Ağustos 2007
Mesajlar
22,184
Excel Vers. ve Dili
Microsoft 365 Tr
Ofis 2016 Tr
#12 numaralı mesajdaki kodları düzenledim. Yeniden deneyiniz.
 

RBozkurt

𐱅𐰇𐰼𐰚
Altın Üye
Katılım
10 Ocak 2018
Mesajlar
681
Excel Vers. ve Dili
Microsoft Office 2024
Google Sheets
Altın Üyelik Bitiş Tarihi
19-12-2026
Teşekkürler @Ömer ustam eline sağlık. Şimdilik hata gözükmüyor, muhtemelen de olmaz gün içinde daha detaylı verilerle çalışıp denerim.
 

RBozkurt

𐱅𐰇𐰼𐰚
Altın Üye
Katılım
10 Ocak 2018
Mesajlar
681
Excel Vers. ve Dili
Microsoft Office 2024
Google Sheets
Altın Üyelik Bitiş Tarihi
19-12-2026
@Ömer ustam merhaba.

7. ve 12. mesajdaki makroları ayrı ayrı aktif olarak kullanmaktayız. 12. mesajdaki makroda hata yoktur. Problemsiz işlemi gerçekleştiriyor.
7. mesajdaki makro nadir olarak eksik veri çekmektedir. Sürekli olmuyor fakat sayısı çok olan listeleme işleminde; Set S1 = Sheets("NetcadRapor") bu sayfadan aldığı verilerde 1 satırda olsa eksiklik denk gelebiliyor. Konu ile ilgili alternatif çözümü varmıdır? Teşekkür ederim.
 

Ömer

Moderatör
Yönetici
Katılım
18 Ağustos 2007
Mesajlar
22,184
Excel Vers. ve Dili
Microsoft 365 Tr
Ofis 2016 Tr
Merhaba,

Konu üzerinden zaman geçtiği için içeriğini hatırlamıyorum fakat son yazdığım #12. mesajdaki kod güncel olan ve doğru çalışan koddur. Bu yüzden #7. mesajdaki kod hatalı olabilir. #7. mesajdaki koda neden ihtiyaç duyuyorsunuz?
 

RBozkurt

𐱅𐰇𐰼𐰚
Altın Üye
Katılım
10 Ocak 2018
Mesajlar
681
Excel Vers. ve Dili
Microsoft Office 2024
Google Sheets
Altın Üyelik Bitiş Tarihi
19-12-2026
7. mesajdaki kod ile;
Set S1 = Sheets("NetcadRapor") sayfasındaki veriyi baz alıp sorguyu
Set S2 = Sheets("MernisListe") sayfasında oluşan mernis listesinde varis olanların bilgileriyle beraber liste hazırlıyor

12. mesajdaki kod ise
Set S1 = Sheets("NetcadRapor") sayfasındaki veriyi baz alıp sorguyu
Set S2 = Sheets("MernisListe") sayfasında oluşan mernis listesinde varis olmadan veri alıyor.

Liste için ayrı ayrı makroya atama yaptım. Kodların ikiside çalışıyor şuan, yukarıda belirttiğim gibi nadiren de olsa 7. msj'da bazen atlama oluyor.
 
Üst