• DİKKAT

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

Sütundaki bir hücreye veri girilince çalışan eğer uygulaması

Katılım
27 Aralık 2010
Mesajlar
56
Excel Vers. ve Dili
Office 2010 TR 64 Bit
Merhabalar,

Alttaki gibi bir kod yazdım. Bu kodlar ile ne yapmak istediklerimi de alttaki kodların yanlarında ' not olarak belirttim. ilk 3 If Not çalışıyor, 4. If Not çalışmıyor. Düzeltmemde yardımcı olur musunuz. Nerede hata yapıyorum. (başka önerileriniz varsa değerlendirebilirim)

Kod:
Private Sub Worksheet_Change(ByVal Target As Range)

    Application.EnableEvents = False
    
    On Error Resume Next
        If Not Intersect(Target, Range("W2:W65536")) Is Nothing Then [COLOR="DarkOliveGreen"]' W sütununa sayı girilirse, X*W yap Y ye yaz[/COLOR]
        sat = Target.Row
        Cells(sat, "Y") = Cells(sat, "W") * Cells(sat, "X")
        
        Else
        
        If Not Intersect(Target, Range("AH2:AH65536")) Is Nothing Then [COLOR="DarkOliveGreen"]' AH sütununa sayı girilirse, AH*AI yap AJ ye yaz [/COLOR]
            sat = Target.Row
            Cells(sat, "AJ") = Cells(sat, "AH") * Cells(sat, "AI")
            
        Else
        
        If Not Intersect(Target, Range("AS2:AS65536")) Is Nothing Then [COLOR="DarkOliveGreen"]' AS sütununa sayı girilirse, AS*AT yap AU ye yaz [/COLOR]
            sat = Target.Row
            Cells(sat, "AU") = Cells(sat, "AS") * Cells(sat, "AT")
            
        Else
       
        If Not Intersect(Target, Range("AV2:AV65536")) Is Nothing Then [COLOR="DarkOliveGreen"]' AV sütununa değer girilirse, O-Z-AK sütunlarına bak hangisine eşit ise alttaki işlemleri yap[/COLOR]
            sat = Target.Row
            
            If Cells(Target, "AV") = Cells(Target, "O") Then [COLOR="DarkOliveGreen"]' AV sütununa girilen değer, O sütunundaki değere eşit ise alttaki hücrelere verileri getir. (Örneğin AW sütunundaki ilgili hücreye P sütunundaki ilgili hücredeki değeri getir)[/COLOR]
            sat = Target.Row
            Cells(sat, "AW") = Cells(sat, "P") And Cells(sat, "AX") = Cells(sat, "Q") And _
            Cells(sat, "AY") = Cells(sat, "R") And Cells(sat, "AZ") = Cells(sat, "S") And _
            Cells(sat, "BA") = Cells(sat, "T") And Cells(sat, "BB") = Cells(sat, "U") And _
            Cells(sat, "BC") = Cells(sat, "V") And Cells(sat, "BD") = Cells(sat, "W") And _
            Cells(sat, "BE") = Cells(sat, "X") And Cells(sat, "BF") = Cells(sat, "Y")
            
            Else
        
            If Cells(sat, "AV") = Cells(sat, "Z") Then  [COLOR="DarkOliveGreen"]' AV sütununa girilen değer, Z sütunundakine eşit ise alttaki hücrelere verileri getir[/COLOR]
            sat = Target.Row
            Cells(sat, "AW") = Cells(sat, "AA") And Cells(sat, "AX") = Cells(sat, "AB") And _
            Cells(sat, "AY") = Cells(sat, "AC") And Cells(sat, "AZ") = Cells(sat, "AD") And _
            Cells(sat, "BA") = Cells(sat, "AE") And Cells(sat, "BB") = Cells(sat, "AF") And _
            Cells(sat, "BC") = Cells(sat, "AG") And Cells(sat, "BD") = Cells(sat, "AH") And _
            Cells(sat, "BE") = Cells(sat, "AI") And Cells(sat, "BF") = Cells(sat, "AJ")
            
            Else
        
            If Cells(sat, "AV") = Cells(sat, "AK") Then [COLOR="DarkOliveGreen"]' AV sütununa girilen değer, AK sütunundakine eşit ise alttaki hücrelere verileri getir[/COLOR]
            sat = Target.Row
            Cells(sat, "AW") = Cells(sat, "AL") And Cells(sat, "AX") = Cells(sat, "AM") And _
            Cells(sat, "AY") = Cells(sat, "AN") And Cells(sat, "AZ") = Cells(sat, "AO") And _
            Cells(sat, "BA") = Cells(sat, "AP") And Cells(sat, "BB") = Cells(sat, "AQ") And _
            Cells(sat, "BC") = Cells(sat, "AR") And Cells(sat, "BD") = Cells(sat, "AS") And _
            Cells(sat, "BE") = Cells(sat, "AT") And Cells(sat, "BF") = Cells(sat, "AU")

            End If
            End If
            End If
        End If
        End If
        End If
        End If
        
   Application.EnableEvents = True
   
End Sub
Saygılar
 
Deneyiniz.

Kod:
Private Sub Worksheet_Change(ByVal Target As Range)
    Dim Satir As Long
    
    On Error GoTo Son
    
    If Target.Cells.Count > 1 Then Exit Sub
    
    Application.EnableEvents = False
    
    If Target.Row > 1 Then
        Satir = Target.Row
        Select Case Target.Column
            Case 23 'W
            
            Cells(Satir, "Y") = Cells(Satir, "W") * Cells(Satir, "X")
    
            Case 34 'AH
            
            Cells(Satir, "AJ") = Cells(Satir, "AH") * Cells(Satir, "AI")
    
            Case 45 'AS
            
            Cells(Satir, "AU") = Cells(Satir, "AS") * Cells(Satir, "AT")
    
            Case 48 'AV
    
            If Cells(Satir, "AV") = Cells(Satir, "O") Then
                Cells(Satir, "AW") = Cells(Satir, "P")
                Cells(Satir, "AX") = Cells(Satir, "Q")
                Cells(Satir, "AY") = Cells(Satir, "R")
                Cells(Satir, "AZ") = Cells(Satir, "S")
                Cells(Satir, "BA") = Cells(Satir, "T")
                Cells(Satir, "BB") = Cells(Satir, "U")
                Cells(Satir, "BC") = Cells(Satir, "V")
                Cells(Satir, "BD") = Cells(Satir, "W")
                Cells(Satir, "BE") = Cells(Satir, "X")
                Cells(Satir, "BF") = Cells(Satir, "Y")
            End If
            
            If Cells(satirir, "AV") = Cells(satirir, "Z") Then
                Cells(Satir, "AW") = Cells(Satir, "AA")
                Cells(Satir, "AX") = Cells(Satir, "AB")
                Cells(Satir, "AY") = Cells(Satir, "AC")
                Cells(Satir, "AZ") = Cells(Satir, "AD")
                Cells(Satir, "BA") = Cells(Satir, "AE")
                Cells(Satir, "BB") = Cells(Satir, "AF")
                Cells(Satir, "BC") = Cells(Satir, "AG")
                Cells(Satir, "BD") = Cells(Satir, "AH")
                Cells(Satir, "BE") = Cells(Satir, "AI")
                Cells(Satir, "BF") = Cells(Satir, "AJ")
            End If
            
            If Cells(Satir, "AV") = Cells(Satir, "AK") Then
                Cells(Satir, "AW") = Cells(Satir, "AL")
                Cells(Satir, "AX") = Cells(Satir, "AM")
                Cells(Satir, "AY") = Cells(Satir, "AN")
                Cells(Satir, "AZ") = Cells(Satir, "AO")
                Cells(Satir, "BA") = Cells(Satir, "AP")
                Cells(Satir, "BB") = Cells(Satir, "AQ")
                Cells(Satir, "BC") = Cells(Satir, "AR")
                Cells(Satir, "BD") = Cells(Satir, "AS")
                Cells(Satir, "BE") = Cells(Satir, "AT")
                Cells(Satir, "BF") = Cells(Satir, "AU")
            End If
        End Select
    End If

Son: Application.EnableEvents = True
End Sub
 
Teşekkür ederim.
 
Geri
Üst