• DİKKAT

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

ChecBox ile hücreyi renklendirme

Katılım
10 Ağustos 2015
Mesajlar
8
Excel Vers. ve Dili
c++
Merhabalar,
Forumdaki örnekleri inceledim ancak istediğim çalışmayı bulamadım yardımcı olursanız sevinirim.

Ekte oluşturduğum bir UserForm çalışmam var;
Örneğin servis talep Checboxını işaretlemediğimde otomatik olarak sarı renginde D3 hücresine HAYIR yazmasını istiyorum işaretlediğimde ise yeşil renginde EVET yazmasını istiyorum.

Şimdiden teşekkürler.
 

Ekli dosyalar

Dosyanız ektedir.:cool:
Kod:
Private Sub CheckBox1_Click()
If CheckBox1.Value = True Then
    Range("D3").Interior.Color = vbGreen
    Range("D3").Value = "EVET"
Else
    Range("D3").Interior.Color = vbYellow
    Range("D3").Value = "HAYIR"
End If
End Sub
 

Ekli dosyalar

Gerçi Sayın Orion1 örneği vermiş. Alternatif olsun.
Kod:
Private Sub CommandButton1_Click()
Dim s1 As Worksheet
Set s1 = Sheets("2015")
son = Range("b1048576").End(xlUp).Row + 1
s1.Cells(son, "B") = TextBox1.Value
s1.Cells(son, "C") = TextBox2.Text
If CheckBox1.Value = True Then
s1.Cells(son, "D") = "EVET": s1.Cells(son, "D").Interior.Color = 5296274
Else
s1.Cells(son, "D") = "HAYIR": s1.Cells(son, "D").Interior.Color = 65535
End If
If CheckBox2.Value = True Then
s1.Cells(son, "E") = "EVET": s1.Cells(son, "E").Interior.Color = 5296274
Else
s1.Cells(son, "E") = "HAYIR": s1.Cells(son, "E").Interior.Color = 65535
End If
If CheckBox3.Value = True Then
s1.Cells(son, "F") = "SAHA": s1.Cells(son, "F").Interior.Color = 5296274
Else
s1.Cells(son, "F") = "TELEFON": s1.Cells(son, "F").Interior.Color = 65535
End If
s1.Cells(son, "B") = TextBox3.Text
s1.Cells(son, "C") = TextBox4.Text
s1.Cells(son, "B") = TextBox5.Text
If CheckBox4.Value = True Then
s1.Cells(son, "J") = "EVET": s1.Cells(son, "J").Interior.Color = 5296274
Else
s1.Cells(son, "J") = "HAYIR": s1.Cells(son, "J").Interior.Color = 65535
End If
If CheckBox5.Value = True Then
s1.Cells(son, "K") = "EVET": s1.Cells(son, "K").Interior.Color = 5296274
Else
s1.Cells(son, "K") = "HAYIR": s1.Cells(son, "K").Interior.Color = 65535
End If
If CheckBox6.Value = True Then
s1.Cells(son, "L") = "SAHA": s1.Cells(son, "L").Interior.Color = 5296274
Else
s1.Cells(son, "L") = "TELEFON": s1.Cells(son, "L").Interior.Color = 65535
End If
s1.Cells(son, "M") = TextBox6.Text
s1.Cells(son, "N") = TextBox7.Value
End Sub
 
Geri
Üst