Soru TextBoxlarda Veri Yoksa Satır Gizlensin

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
 

hmtstc

Altın Üye
Katılım
20 Şubat 2014
Mesajlar
314
Excel Vers. ve Dili
Excel 2016 - Türkçe
Altın Üyelik Bitiş Tarihi
10-04-2025
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
 
Katılım
9 Ekim 2009
Mesajlar
1,626
Excel Vers. ve Dili
türkçe
2003
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
 

YUSUF44

Destek Ekibi
Destek Ekibi
Katılım
4 Ocak 2006
Mesajlar
12,071
Excel Vers. ve Dili
İş : Ofis 365 - Türkçe
Ev: Ofis 365 - Türkçe
İlk kodda hidden yerine hide kullanılmış, ondan olabilir.
 

hmtstc

Altın Üye
Katılım
20 Şubat 2014
Mesajlar
314
Excel Vers. ve Dili
Excel 2016 - Türkçe
Altın Üyelik Bitiş Tarihi
10-04-2025
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,
 
Katılım
9 Ekim 2009
Mesajlar
1,626
Excel Vers. ve Dili
türkçe
2003
Çok teşekkür ederim bu işlemi buton ile değilde ,textboxlarda işlem yaptığım zaman otomatik olarak yapamaz mıyız?
 

Korhan Ayhan

Administrator
Yönetici
Admin
Katılım
15 Mart 2005
Mesajlar
42,748
Excel Vers. ve Dili
Microsoft 365 Tr-En 64 Bit
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
 
Üst