TextBox1 boş ise uyarı versin

Katılım
8 Haziran 2007
Mesajlar
761
Excel Vers. ve Dili
excel- 2003 Türkçe
Private Sub Sil_Click()
Sheets("Personel_Bilgi").Select

If MsgBox("Seçmiş olduğunuz kişi personel_Bilgi sayfasından tamamen silinecektir.?", vbQuestion) = vbNo Then
TextBox1.SetFocus
End If
If TextBox1.Value = "" Then Exit Sub
Set k = Range("B11:B65536").Find(TextBox1.Value, , xlValues, xlWhole)
If Not k Is Nothing Then
Cells(k.Row, "B") = Empty 'PERSONEL NO
Cells(k.Row, "C") = Empty 'ÜNVANI
Cells(k.Row, "D") = Empty 'ADI


Yukarıdaki butona tıklayınca hemen "Seçmiş olduğunuz kişi personel_Bilgi sayfasından tamamen silinecektir" BU UYARIYI VERİYOR.

Textbox1 boş ise " Personel no boş olamaz uyarısı versin
sonra eğer TextBox1 dolu ise yukarıdaki uyarıyı versin
 

Orion1

Uzman
Uzman
Katılım
1 Mart 2005
Mesajlar
22,254
Excel Vers. ve Dili
Win7 Home Basic TR 64 Bit

Ofis-2010-TR 32 Bit
Private Sub Sil_Click()
Sheets("Personel_Bilgi").Select

If MsgBox("Seçmiş olduğunuz kişi personel_Bilgi sayfasından tamamen silinecektir.?", vbQuestion) = vbNo Then
TextBox1.SetFocus
End If
If TextBox1.Value = "" Then Exit Sub
Set k = Range("B11:B65536").Find(TextBox1.Value, , xlValues, xlWhole)
If Not k Is Nothing Then
Cells(k.Row, "B") = Empty 'PERSONEL NO
Cells(k.Row, "C") = Empty 'ÜNVANI
Cells(k.Row, "D") = Empty 'ADI


Yukarıdaki butona tıklayınca hemen "Seçmiş olduğunuz kişi personel_Bilgi sayfasından tamamen silinecektir" BU UYARIYI VERİYOR.

Textbox1 boş ise " Personel no boş olamaz uyarısı versin
sonra eğer TextBox1 dolu ise yukarıdaki uyarıyı versin
Aşağıdaki kodu deneyiniz.:cool:
Kod:
Private Sub Sil_Click()
Sheets("Personel_Bilgi").Select
[COLOR="Red"][B]if textbox1.value = ""  then 
       msgbox "Personel no boş olamaz..!!"
       textbox1.setfocus
       exit sub
end if[/B][/COLOR]
If MsgBox("Seçmiş olduğunuz kişi personel_Bilgi sayfasından tamamen silinecektir.?", vbQuestion) = vbNo Then
    TextBox1.SetFocus
   End If
If TextBox1.Value = "" Then Exit Sub
Set k = Range("B11:B65536").Find(TextBox1.Value, , xlValues, xlWhole)
If Not k Is Nothing Then
Cells(k.Row, "B") = Empty 'PERSONEL NO
Cells(k.Row, "C") = Empty 'ÜNVANI
Cells(k.Row, "D") = Empty 'ADI
 
Üst