• DİKKAT

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

checkbox işaretli değilse

  • Konbuyu başlatan Konbuyu başlatan arda896
  • Başlangıç tarihi Başlangıç tarihi

arda896

Altın Üye
Katılım
6 Ocak 2023
Mesajlar
19
Excel Vers. ve Dili
excel access
Kod:
Private Sub CheckBox2_Click()
Dim i
Range("A1") = "Deneme"
sonsatir = Cells(Rows.Count, "A").End(xlUp).Row + 1
For i = 2 To sonsatir
If CheckBox2 = True Then
Cells(i, 1) = Label1
Else
Cells(Rows.Count, "A").End (xlUp) . Clear

End If

Next i
End Sub


If CheckBox2 = True Then
Cells(i, 1) = Label1
Else
Cells(Rows.Count, "A").End (xlUp).Clear

End If

burda checbox işaretlenince doğru çalışıyor fakat işaretten çıkınca son eklenen değeri silmesini istiyorum
 
Cells(Rows.Count, "A").End (xlUp).Clear


tüm sütunu siliyor
 
range("A" & Cells(Rows.Count, "A").End (xlUp)).clear

Bu şekilde düzeltip deneyiniz.
 
Range("A" & Cells(Rows.Count, "A").End(xlUp).Row).Clear
 
Kod:
....
    Else
        Dim lastRow As Long
        lastRow = Cells(Rows.Count, "A").End(xlUp).Row
        Cells(lastRow, "A").ClearContents
    End If
.......
 
Geri
Üst