• DİKKAT

    DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
    Altın Üyelik Hakkında Bilgi

2 yıla ait verileri karşılaştırma

  • Konbuyu başlatan Konbuyu başlatan mbldn
  • Başlangıç tarihi Başlangıç tarihi
Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...
Katılım
7 Mart 2011
Mesajlar
184
Excel Vers. ve Dili
2007 TR
sevgili hocalarım ve arkadaşlar merhaba;
yine tıkandığım bir noktada yardımınıza ihtiyacım var. ekli dosyada detaylı anlattığım olay şudur ki;
veri sayfama iki farklı sayfadan değerleri çağırıyorum. ama hata alıyorum.
yardım edebilen arkadaşa şimdiden teşekkürler
 

Ekli dosyalar

Stok kodları aynı olmak kaydıyla; aşağıdaki gibi olabilir.

Kod:
Private Sub ComboBox1_Change()
[b5:g65000] = Empty
With Worksheets("geçmiş_yıl").Range("a1:a65000")
Set c = .Find(ComboBox1.Value, LookIn:=xlValues)
    If Not c Is Nothing Then
       Adres = c.Address
        Do
        a = Cells(65000, 2).End(xlUp).Row + 1
        Range("b" & a & ":e" & a).Value = Worksheets("geçmiş_yıl").Range("b" & c.Row & ":e" & c.Row).Value
    Set d = Worksheets("cy").Range("a1:a65000").Find(ComboBox1.Value, LookIn:=xlValues)
    If Not d Is Nothing Then
       Adres2 = d.Address
        Do
        b = Cells(65000, 2).End(xlUp).Row
        If Worksheets("cy").Cells(d.Row, 2) = Cells(b, 2) Then
        Range("f" & b & ":g" & b).Value = Worksheets("cy").Range("d" & d.Row & ":e" & d.Row).Value
          End If
            Set d = Worksheets("cy").Range("a1:a65000").FindNext(d)
        Loop While Not d Is Nothing And d.Address <> Adres2
    End If
            Set c = .FindNext(c)
        Loop While Not c Is Nothing And c.Address <> Adres
    End If
End With
End Sub
 
Stok kodları aynı olmak kaydıyla; aşağıdaki gibi olabilir.

Kod:
Private Sub ComboBox1_Change()
[b5:g65000] = Empty
With Worksheets("geçmiş_yıl").Range("a1:a65000")
Set c = .Find(ComboBox1.Value, LookIn:=xlValues)
    If Not c Is Nothing Then
       Adres = c.Address
        Do
        a = Cells(65000, 2).End(xlUp).Row + 1
        Range("b" & a & ":e" & a).Value = Worksheets("geçmiş_yıl").Range("b" & c.Row & ":e" & c.Row).Value
    Set d = Worksheets("cy").Range("a1:a65000").Find(ComboBox1.Value, LookIn:=xlValues)
    If Not d Is Nothing Then
       Adres2 = d.Address
        Do
        b = Cells(65000, 2).End(xlUp).Row
        If Worksheets("cy").Cells(d.Row, 2) = Cells(b, 2) Then
        Range("f" & b & ":g" & b).Value = Worksheets("cy").Range("d" & d.Row & ":e" & d.Row).Value
          End If
            Set d = Worksheets("cy").Range("a1:a65000").FindNext(d)
        Loop While Not d Is Nothing And d.Address <> Adres2
    End If
            Set c = .FindNext(c)
        Loop While Not c Is Nothing And c.Address <> Adres
    End If
End With
End Sub

Teşekkürler işin içinden çıkamamıştım tam istediğim gibi oldu
saygılar
 
Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...
Geri
Üst