• DİKKAT

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

Boş nesneler için uyarı mesajı sorunu ?

Katılım
31 Ağustos 2010
Mesajlar
387
Excel Vers. ve Dili
Excel 2007-2010 Eng
Open Office Trk
Selamlar, birtürlü yapamadığım olay şöyle ;

Userformda belli nesneler boşsa ve optionbutton lardan herhangi biri yada togglebuttonlardan herhangi bir seçili değil ise uyarı mesajı gelsin ve kayıt yapmasın istiyorum. (Birtek optionbutton3 seçili ise togglebutton durumu bakılmaksızın kayıt yapsın istiyorum)

Bu şartları sağlayacak kodlarda yardımcı olursanız çok çok işime yarayacak. Örnek dosyamıda ekledim, ordada açıkladım.
Yardımlarınız için şimdiden çok çok teşekkürler.....
 

Ekli dosyalar

Selamlar, birtürlü yapamadığım olay şöyle ;

Userformda belli nesneler boşsa ve optionbutton lardan herhangi biri yada togglebuttonlardan herhangi bir seçili değil ise uyarı mesajı gelsin ve kayıt yapmasın istiyorum. (Birtek optionbutton3 seçili ise togglebutton durumu bakılmaksızın kayıt yapsın istiyorum)

Bu şartları sağlayacak kodlarda yardımcı olursanız çok çok işime yarayacak. Örnek dosyamıda ekledim, ordada açıkladım.
Yardımlarınız için şimdiden çok çok teşekkürler.....

Tam olarak anlıyamadım ama bu kodu denermisiniz.

Kod:
Private Sub CommandButton1_Click()
Dim Satır As Long
Satır = Range("A65536").End(3).Row + 1
If OptionButton3 = True Then
Cells(Satır, "h") = OptionButton3.Caption
Else
If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" Or ComboBox1.Text = "" Or _
ComboBox2.Text = "" Or ComboBox3.Text = "" Then
MsgBox "Eksik Var !"
Exit Sub
End If
End If
Cells(Satır, "a") = Satır - 1
Cells(Satır, "b") = ComboBox1.Text
Cells(Satır, "c") = TextBox1.Text
Cells(Satır, "e") = TextBox2.Text
Cells(Satır, "g") = TextBox3.Text
Cells(Satır, "I") = ComboBox2.Text
Cells(Satır, "f") = ComboBox3.Text
If OptionButton1 = True Then
Cells(Satır, "h") = OptionButton1.Caption
End If
If OptionButton2 = True Then
Cells(Satır, "h") = OptionButton2.Caption
End If
If ToggleButton1 = True Then
Cells(Satır, "j") = ToggleButton1.Caption
Else
Cells(Satır, "j") = ToggleButton2.Caption
End If
MsgBox "Kaydedildi."

End Sub
 
Halit hocam çok teşekkür ederim, istediğim bu şekildeydi birde ek olarak, togglebutton lardan herhangi biride tıklı değil ise uyarı mesajı gelmesini sağlayabilirmiyiz. Teşekkürler.
 
Halit hocam çok teşekkür ederim, istediğim bu şekildeydi birde ek olarak, togglebutton lardan herhangi biride tıklı değil ise uyarı mesajı gelmesini sağlayabilirmiyiz. Teşekkürler.

Böyle olabilrmi,?

Kod:
Private Sub CommandButton1_Click()
Dim Satır As Long
Satır = Range("A65536").End(3).Row + 1
If OptionButton3 = True Then
Cells(Satır, "h") = OptionButton3.Caption
Else
If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" Or ComboBox1.Text = "" Or _
ComboBox2.Text = "" Or ComboBox3.Text = "" Then
MsgBox "Eksik Var !"
Exit Sub
End If
If ToggleButton1 = False Or ToggleButton2 = False Then
MsgBox "ToggleButton tıklı değil !"
Exit Sub
End If

End If
Cells(Satır, "a") = Satır - 1
Cells(Satır, "b") = ComboBox1.Text
Cells(Satır, "c") = TextBox1.Text
Cells(Satır, "e") = TextBox2.Text
Cells(Satır, "g") = TextBox3.Text
Cells(Satır, "I") = ComboBox2.Text
Cells(Satır, "f") = ComboBox3.Text
If OptionButton1 = True Then
Cells(Satır, "h") = OptionButton1.Caption
End If
If OptionButton2 = True Then
Cells(Satır, "h") = OptionButton2.Caption
End If
If ToggleButton1 = True Then
Cells(Satır, "j") = ToggleButton1.Caption
Else
Cells(Satır, "j") = ToggleButton2.Caption
End If
MsgBox "Kaydedildi."
End Sub
 
Exit Sub mantığını şimdi anladım. Çok teşekkür ederim hocam halloldu. Saygılar selamlar...
 
Geri
Üst