• DİKKAT

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

Sayfadan Forma Veri Çekme

Katılım
10 Eylül 2009
Mesajlar
288
Excel Vers. ve Dili
2003 Türkçe
Aşağıdaki kod ile sorgu sayfasından Forma veri çekiyorum ancak sayfadaki hücre boş ise hata veriyor. Ben ise MsgBox ile uyarmasını istiyorum. If yöntemi ile bir şeyler yapmaya çalıştım ancak olmadı. Kodu ne şekilde düzenlemeliyim bilmiyorum.

Saygılarımla..

Kod:
Private Sub CommandButton41_Click()
Sheets("SORGU").Select
Sheets("SORGU").Range("A1").Value = TextBox1.Value
Range("B1").Select
Label5.Caption = Sheets("SORGU").Range("A2").Value
Label6.Caption = Sheets("SORGU").Range("B2").Value
Label7.Caption = Sheets("SORGU").Range("C2").Value
End Sub
 
Kod:
Private Sub CommandButton41_Click()
'Coder By Security
Sheets("SORGU").Select
Sheets("SORGU").Range("A1").Value = TextBox1.Value
Range("B1").Select
If Sheets("SORGU").Range("A2").Value = "" Then
MsgBox "A2 Hücresi Boş ", vbCritical, "HATA"
End If
If Sheets("SORGU").Range("b2").Value = "" Then
MsgBox "B2 Hücresi Boş ", vbCritical, "HATA"
End If
If Sheets("SORGU").Range("c2").Value = "" Then
MsgBox "C2 Hücresi Boş ", vbCritical, "HATA"
End If
Label5.Caption = Sheets("SORGU").Range("A2").Value
Label6.Caption = Sheets("SORGU").Range("B2").Value
Label7.Caption = Sheets("SORGU").Range("C2").Value
End Sub

Şeklinde Denermisiniz...
 
Kod:
Private Sub CommandButton41_Click()
'Coder By Security
Sheets("SORGU").Select
Sheets("SORGU").Range("A1").Value = TextBox1.Value
Range("B1").Select
[COLOR="Red"]If Sheets("SORGU").Range("A2").Value = "" Then[/COLOR]
MsgBox "A2 Hücresi Boş ", vbCritical, "HATA"
End If
If Sheets("SORGU").Range("b2").Value = "" Then
MsgBox "B2 Hücresi Boş ", vbCritical, "HATA"
End If
If Sheets("SORGU").Range("c2").Value = "" Then
MsgBox "C2 Hücresi Boş ", vbCritical, "HATA"
End If
Label5.Caption = Sheets("SORGU").Range("A2").Value
Label6.Caption = Sheets("SORGU").Range("B2").Value
Label7.Caption = Sheets("SORGU").Range("C2").Value
End Sub

Şeklinde Denermisiniz...

Sayın Security Teşekkür ederim, belirttiğim satırda hata vermeye devam ediyor.



Saygılarımla..
 
örnek dosya eklermisiniz .. kodda sorun yok.. sizin dosyanızda uygulayalım..
 
Ekli dosyayı Denermisiniz... Biraz değişiklik yaptım...
 

Ekli dosyalar

Son düzenleme:
Geri
Üst