Userform'da Onay Kutusuna Kod Yazma

Katılım
17 Mayıs 2005
Mesajlar
13
Excelde VBA da bir userform haz1rlad1m.. ama bu userforma onay kutusu koydugumda nas1l kod yazacag1m1 bilmiyorum..

mesela onay kutusu isaretli ise "EVET"
isaretli diilse "HAYIR" yazs1n istiyorum.. A1 kutusuna

VBA kodunu nas1l yazar1m??
 

Levent Menteşoğlu

Administrator
Yönetici
Admin
Katılım
13 Ekim 2004
Mesajlar
16,057
Excel Vers. ve Dili
Excel 2010-32 bit-Türkçe
Excel 365 -32 bit-Türkçe
Aşağıdaki kodu deneyin.

[vb:1:72f10dee14]Private Sub CheckBox1_Click()
[a1] = "HAYIR"
If CheckBox1.Value = True Then [a1] = "EVET"
End Sub
[/vb:1:72f10dee14]
 
Katılım
17 Mayıs 2005
Mesajlar
13
tesekkür ederim..
dee..
bisey daha sorabilir miyim??

ya durum su..

Sub CommandButton1_Click()
Dim DoluSay As Integer
DoluSay = WorksheetFunction.CountA([B8:B1500]) + 8
If TextBox1 = "" Then
MsgBox "TC KİMLİK NO TEXTBOX BOÞ OLAMAZ!! 11 HANELİ TC KİMLİK NOSUNU GİRMELİSİNİZ!!"

Exit Sub
End If
Cells(DoluSay, "B").Value = [DoluSay] - 7
Cells(DoluSay, "D").Value = [DoluSay] - 7
Cells(DoluSay, "E").Value = TextBox1.Value
Cells(DoluSay, "H").Value = TextBox3.Value
Cells(DoluSay, "I").Value = TextBox5.Value
Cells(DoluSay, "J").Value = TextBox7.Value
Cells(DoluSay, "K").Value = TextBox8.Value
Cells(DoluSay, "L").Value = TextBox9.Value
Cells(DoluSay, "M").Value = TextBox10.Value
Cells(DoluSay, "N").Value = TextBox11.Value
Cells(DoluSay, "O").Value = TextBox12.Value
Cells(DoluSay, "p").Value = CheckBox1_Click()
[p1] = "H"
If CheckBox1.Value = True Then [p1] = "E"

End Sub

Private Sub CommandButton10_Click()
Sheets("Ek1").Select
Range("A1").Select
End Sub

Private Sub CommandButton11_Click()
Sheets("Ek3").Select
Range("A1").Select
End Sub

Private Sub CommandButton12_Click()
Sheets("Ek20").Select
Range("A1").Select
End Sub

Private Sub CommandButton13_Click()
Sheets("Sayfa1").Select
Range("c5").Select
End Sub

Private Sub CommandButton14_Click()
Sheets("boş").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("sayfa1").Select
End Sub

Private Sub CommandButton15_Click()
Sheets("ana").Select
Range("A1").Select
End Sub

Private Sub CommandButton2_Click()
Dim DoluSay As Integer
DoluSay = WorksheetFunction.CountA([B8:B1500]) + 8
Cells(DoluSay - 1, "b").Value = ""
Cells(DoluSay - 1, "D").Value = ""
Cells(DoluSay - 1, "E").Value = ""
Cells(DoluSay - 1, "H").Value = ""
Cells(DoluSay - 1, "I").Value = ""
Cells(DoluSay - 1, "J").Value = ""
Cells(DoluSay - 1, "K").Value = ""
Cells(DoluSay - 1, "L").Value = ""
Cells(DoluSay - 1, "M").Value = ""
Cells(DoluSay - 1, "N").Value = ""
Cells(DoluSay - 1, "O").Value = ""

End Sub

Private Sub CommandButton3_Click()
TextBox1 = ""
TextBox3 = ""
TextBox5 = ""
TextBox7 = ""
TextBox8 = ""
TextBox9 = ""
TextBox10 = ""
TextBox11 = ""
TextBox12 = ""

End Sub

Private Sub CommandButton4_Click()
Sheets("ek1").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("ek3").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("ek20").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("sayfa1").Select

End Sub

Private Sub CommandButton5_Click()
UserForm1.Hide
End Sub

Private Sub CommandButton6_Click()
Sheets("ek1").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("sayfa1").Select
End Sub

Private Sub CommandButton7_Click()
Sheets("ek3").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("sayfa1").Select
End Sub

Private Sub CommandButton8_Click()
Sheets("ek20").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("sayfa1").Select
End Sub

Private Sub CommandButton9_Click()
Sheets("1").Select
Range("A1").Select
End Sub

böyle bir sey var.. ve ben her "kaydet" dedigimde bir sonraki sat1ra kaydediyo.. ben buna bir de onay kutusu (checkbox) eklemek istiyoru.. ve bu onay kutusu her seferinde bir sonraki sat1ra "evet" ya da "hay1r" yazs1n.. ama bi türlü yapamad1m..
yard1mlar1n1z için _imdiden te_ekkürlerrr..
 
X

xxrt

Misafir
Cells(DoluSay, "p").Value = IIf(CheckBox1,"Evet","Hayır")

Denemedim ama bir de bunu deneyin.
 
Üst