• DİKKAT

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

Soru TextBoxlarda Veri Yoksa Satır Gizlensin

  • Konbuyu başlatan Konbuyu başlatan ormann
  • Başlangıç tarihi Başlangıç tarihi
Katılım
9 Ekim 2009
Mesajlar
1,626
Excel Vers. ve Dili
türkçe
2003
İyi günler ekli örnek dosyada Userform1 deki TextBox1 de veri yoksa Harita sayfasında G7 satırı gizlenecek;TextBox2 de veri yoksa Harita sayfasında G9 satırı gizlenecek ve TextBox3 de veri yoksa Harita sayfasında G11 satırı gizlenecek;Veri varsa gösterilecek. Yardımcı olur musunuz .Saygılar
 
G11 satır mı oluyor hücre mi ? 11. satır gizlenir ya da gösterilir. Aynı şekilde G sütunu gizlenir ya da gösterilir. Blok olduğu için dosyayı indiremedim. yoksa sistem basit.

Private Sub CommandButton1_Click()



If UserForm1.TextBox1.Text = Empty Then

Sheets("Harita").Rows(7).Hide = True

End If

If UserForm1.TextBox2.Text = Empty Then

Sheets("Harita").Rows(9).Hidden = True

End If

If UserForm1.TextBox3.Text = Empty Then

Sheets("Harita").Rows(11).Hidden = True

End If

End Sub
 
G11 satır mı oluyor hücre mi ? 11. satır gizlenir ya da gösterilir. Aynı şekilde G sütunu gizlenir ya da gösterilir. Blok olduğu için dosyayı indiremedim. yoksa sistem basit.

Private Sub CommandButton1_Click()



If UserForm1.TextBox1.Text = Empty Then

Sheets("Harita").Rows(7).Hide = True

End If

If UserForm1.TextBox2.Text = Empty Then

Sheets("Harita").Rows(9).Hidden = True

End If

If UserForm1.TextBox3.Text = Empty Then

Sheets("Harita").Rows(11).Hidden = True

End If

End Sub
Sayın hmtstc merhabalar;
TextBoxlarda veri olmadığı zaman hata veriyor
 
İlk kodda hidden yerine hide kullanılmış, ondan olabilir.
 
Private Sub CommandButton1_Click()

If UserForm1.TextBox1.Text = Empty Then

Sheets("Harita").Rows(7).Hidden = True

End If

If UserForm1.TextBox2.Text = Empty Then

Sheets("Harita").Rows(9).Hidden = True

End If

If UserForm1.TextBox3.Text = Empty Then

Sheets("Harita").Rows(11).Hidden = True

End If

End Sub




YUSUF44 hocam uyarı için teşekkürler,
 
Çok teşekkür ederim bu işlemi buton ile değilde ,textboxlarda işlem yaptığım zaman otomatik olarak yapamaz mıyız?
 
Deneyiniz.

C++:
Option Explicit

Private Sub TextBox1_Change()
    Kontrol
End Sub

Private Sub TextBox2_Change()
    Kontrol
End Sub

Private Sub TextBox3_Change()
    Kontrol
End Sub

Private Sub UserForm_Initialize()
    Kontrol
End Sub

Sub Kontrol()
    Dim Nesne As Control
    
    Application.ScreenUpdating = False
    
    Sheets("HARİTA").Cells.EntireRow.Hidden = False
    
    For Each Nesne In Userform1.Controls
        If TypeName(Nesne) = "TextBox" Then
            Select Case Nesne.Name
                Case "TextBox1"
                    Sheets("HARİTA").Rows(7).Hidden = Not Len(TextBox1) <> 0
                Case "TextBox2"
                    Sheets("HARİTA").Rows(9).Hidden = Not Len(TextBox2) <> 0
                Case "TextBox3"
                    Sheets("HARİTA").Rows(11).Hidden = Not Len(TextBox3) <> 0
            End Select
        End If
    Next
    
    Application.ScreenUpdating = True
End Sub
 
Geri
Üst