end if sorunu

Katılım
29 Haziran 2007
Mesajlar
201
Excel Vers. ve Dili
ofis20007
aşağıdaki şekilde texboxın change özelliğine yazılan kod da
'End If komutları nerelere yazılır ve adedi neye bağlıdır?daha doğrusu ıf komutuna mı bağlı yoksa else komutuna mı?
If s1.Cells(sat, 78).Value = "ERKEK" Then ÇOCUK126 = True
If s1.Cells(sat, 78).Value = "KIZ" Then ÇOCUK127 = True
If s1.Cells(sat, 79).Value = "ŞNT" Then ÇOCUK128 = True
Else
ÇOCUK128 = False
End If
If s1.Cells(sat, 80).Value = "BURSLU" Then ÇOCUK129 = True
Else
ÇOCUK129 = False
End If
If s1.Cells(sat, 81).Value = ÇOCUK130.Caption Then ÇOCUK130 = True
If s1.Cells(sat, 81).Value = ÇOCUK131.Caption Then ÇOCUK131 = True
If s1.Cells(sat, 82).Value = "BAKMAKLA YÜKÜMLÜ" Then ÇOCUK132 = True
Else
ÇOCUK132 = False
End If
 
Katılım
27 Temmuz 2004
Mesajlar
719
Excel Vers. ve Dili
Excel 2003 Tr
Şu şekilde dener misiniz
Kod:
If s1.Cells(sat, 78).Value = "ERKEK" Then ÇOCUK126 = True
If s1.Cells(sat, 78).Value = "KIZ" Then ÇOCUK127 = True

If s1.Cells(sat, 79).Value = "ŞNT" Then ÇOCUK128 = True
Else: ÇOCUK128 = False

If s1.Cells(sat, 80).Value = "BURSLU" Then ÇOCUK129 = True
Else: ÇOCUK129 = False

If s1.Cells(sat, 81).Value = ÇOCUK130.Caption Then ÇOCUK130 = True
If s1.Cells(sat, 81).Value = ÇOCUK131.Caption Then ÇOCUK131 = True

If s1.Cells(sat, 82).Value = "BAKMAKLA YÜKÜMLÜ" Then ÇOCUK132 = True
Else: ÇOCUK132 = False
 
Katılım
27 Temmuz 2004
Mesajlar
719
Excel Vers. ve Dili
Excel 2003 Tr
Bu da işinizi görebilir
Kod:
If s1.Cells(sat, 78).Value = "ERKEK" Then ÇOCUK126 = True
If s1.Cells(sat, 78).Value = "KIZ" Then ÇOCUK127 = True
ÇOCUK128 = False
If s1.Cells(sat, 79).Value = "ŞNT" Then ÇOCUK128 = True
ÇOCUK129 = False
If s1.Cells(sat, 80).Value = "BURSLU" Then ÇOCUK129 = True
If s1.Cells(sat, 81).Value = ÇOCUK130.Caption Then ÇOCUK130 = True
If s1.Cells(sat, 81).Value = ÇOCUK131.Caption Then ÇOCUK131 = True
ÇOCUK132 = False
If s1.Cells(sat, 82).Value = "BAKMAKLA YÜKÜMLÜ" Then ÇOCUK132 = True
 
Katılım
29 Haziran 2007
Mesajlar
201
Excel Vers. ve Dili
ofis20007
SLM.ARKADAŞLAR VERDİĞİNİZ KODLARI YAZDIĞIMDA ELSE DE HATA MESAJI VERİYOR.BU ŞEKİLDE DE YAZINCA DA İSTEDİKLERİM OLMUYOR.YANİ OPTİONBUTONLAR PASİF AMA SEÇİLİ OLUYOR.YARDIMLARINIZI BEKLİYOTUM.TŞK.

If Sheets("OGRETMENKAYIT").Cells(Son + 1, 78) = "KIZ" Then ÇOCUK126.Value = True
If Sheets("OGRETMENKAYIT").Cells(Son + 1, 78) = "ERKEK" Then ÇOCUK127.Value = True
If Sheets("OGRETMENKAYIT").Cells(Son + 1, 79) = "ŞNT" Then ÇOCUK128.Value = True
ÇOCUK128.Value = False
If Sheets("OGRETMENKAYIT").Cells(Son + 1, 80) = "BURSLU" Then ÇOCUK129.Value = True
ÇOCUK129.Value = False
If Sheets("OGRETMENKAYIT").Cells(Son + 1, 81) = "EVLİ" Then ÇOCUK130.Value = True
If Sheets("OGRETMENKAYIT").Cells(Son + 1, 81) = "BEKAR" Then ÇOCUK131.Value = True
If Sheets("OGRETMENKAYIT").Cells(Son + 1, 82) = "BAKMAKLA YÜKÜMLÜ" Then ÇOCUK132.Value = True
ÇOCUK132.Value = False
 
Son düzenleme:
Katılım
27 Temmuz 2004
Mesajlar
719
Excel Vers. ve Dili
Excel 2003 Tr
Dosya olmadan anlamak zor oluyor ama yukarıda verdiğiniz örnekte hatalı satırlar var
Kod:
If Sheets("OGRETMENKAYIT").Cells(Son + 1, 79) = "ŞNT" Then ÇOCUK128.Value = True
ÇOCUK128.Value = False
şeklinde bir satır yazıyor iseniz ÇOCUK128.Value her halükarda false olur çünkü ilk satırda true olmuş olsa bile alt satırsa hiç bir koşula bağlı olmadan tekrar false oluyor, yazış sırasını değiştirmeniz lazım. Aşağıdaki gibi
Kod:
ÇOCUK128.Value = False
If Sheets("OGRETMENKAYIT").Cells(Son + 1, 79) = "ŞNT" Then ÇOCUK128.Value = True
 

halit3

Uzman
Uzman
Katılım
18 Ocak 2008
Mesajlar
12,844
Excel Vers. ve Dili
2003 excell türkçe
ve
2007 excell türkçe
evet dosya olmadan zor
 
Üst