VBA kod yardımı

Mehmet Sait

Altın Üye
Katılım
19 Ekim 2009
Mesajlar
840
Excel Vers. ve Dili
Office 2016 TR
Altın Üyelik Bitiş Tarihi
08-09-2028
Merhabalar,

Çalışma sayfamın kod bölümünde bulunan bu kod ile F hücresi değiştiğinde M hücresini temizliyor. Bu koda F hücresi değiştiğinde birde G hücresininde temizlemesini istiyorum ama koda ekleme yapamadım.

Kod:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Intersect(Target, [F11:F45]) Is Nothing Then Exit Sub
    Cells(Target.Row, "M") = ""
End Sub
Yardımlarınız için teşekkür ederim
 

ÖmerFaruk

Destek Ekibi
Destek Ekibi
Katılım
22 Ekim 2017
Mesajlar
4,784
Excel Vers. ve Dili
Microsoft 365 Tr-64
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, [F11:F45]) Is Nothing Then Exit Sub
Cells(Target.Row, "M") = ""
Cells(Target.Row, "G") = ""
End Sub
 

Mehmet Sait

Altın Üye
Katılım
19 Ekim 2009
Mesajlar
840
Excel Vers. ve Dili
Office 2016 TR
Altın Üyelik Bitiş Tarihi
08-09-2028
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, [F11:F45]) Is Nothing Then Exit Sub
Cells(Target.Row, "M") = ""
Cells(Target.Row, "G") = ""
End Sub
Hocam, emeğinize sağlık teşekkür ederim. Denedim oldu. Teşekkür ederim.

F Hücresi silindiğinde G ile M temizlensin eğer sadece G hücreside silinirse M yine temizlensin
Bu şekilde revize etmek istedim ama yapamadım.

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, [G11:G45]) Is Nothing Then Exit Sub
Cells(Target.Row, "M") = ""
If Intersect(Target, [F11:F45]) Is Nothing Then Exit Sub
Cells(Target.Row, "G") = ""
Cells(Target.Row, "M") = ""
End Sub

Teşekkür ederim.
 

ÖmerFaruk

Destek Ekibi
Destek Ekibi
Katılım
22 Ekim 2017
Mesajlar
4,784
Excel Vers. ve Dili
Microsoft 365 Tr-64
C++:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Intersect(Target, [G11:G45]) Is Nothing Then GoTo ATLA
    Cells(Target.Row, "M") = ""
    Exit Sub
ATLA:
    If Intersect(Target, [F11:F45]) Is Nothing Then Exit Sub
    Cells(Target.Row, "G") = ""
    Cells(Target.Row, "M") = ""
End Sub
 

Mehmet Sait

Altın Üye
Katılım
19 Ekim 2009
Mesajlar
840
Excel Vers. ve Dili
Office 2016 TR
Altın Üyelik Bitiş Tarihi
08-09-2028
C++:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Intersect(Target, [G11:G45]) Is Nothing Then GoTo ATLA
    Cells(Target.Row, "M") = ""
    Exit Sub
ATLA:
    If Intersect(Target, [F11:F45]) Is Nothing Then Exit Sub
    Cells(Target.Row, "G") = ""
    Cells(Target.Row, "M") = ""
End Sub
Emeğinize sağlık, teşekkür ederim hocam.
 
Üst