• DİKKAT

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

combobox ve textbook temizleme

Katılım
30 Mart 2008
Mesajlar
44
Excel Vers. ve Dili
EXCEL 2007 TÜRKÇE
Merhaba ustalarım,
ben bir userform oluşturuytorum.bu userform da çok fazla textbook,combobox mevcuttur. bir commandbutton yardımı ile nasıl tek tula silebilirim.
benim userformda kullandığım kod aşağıdadır.
yardımcı olursanız sevinirim. iyi çalışmalar.


Private Sub CommandButton5_Click()
For Each txt In Me.Controls
If Left(txt.Name, 7) = "TextBox" Then
txt.Value = ""

End If
Next
End Sub
 
İşte kodlar.:cool:
Kod:
Private Sub CommandButton1_Click()
Dim obj As Object
For Each obj In Me.Controls
    If TypeName(obj) = "TextBox" Or TypeName(obj) = "ComboBox" Then
        obj.Value = Empty
    End If
Next
End Sub
 
ellerine sağlık

üstadım ellerine sağlık.
senden daha çok öğreneceğim şeyler var.

iyi çalışmalar.
 
bu formülde hata veriyor :(


Private Sub CommandButton1_Click()

Dim Satir As Long, Say As Byte
Satir = Range("A65536").End(3).Row + 1
Cells(Satir, "A") = TextBox1.Text
Cells(Satir, "B") = ComboBox1.Value
MsgBox "Kayıt İşlemi Tamamlanmıştır"

ComboBox1.ListFillRange = "list!$A$1:$A$50"


Dim obj As Object
For Each obj In Me.Controls
If TypeName(obj) = "TextBox" Or TypeName(obj) = "ComboBox" Then
obj.Value = Empty
End If
Next
End Sub


End Sub


ama şöyle çözdüm;

:)

Kod:
Private Sub CommandButton1_Click()

Dim Satir As Long, Say As Byte
Satir = Range("A65536").End(3).Row + 1
Cells(Satir, "A") = TextBox1.Text
Cells(Satir, "B") = ComboBox1.Value
MsgBox "Kayıt İşlemi Tamamlanmıştır"
TextBox1.Text = ""
ComboBox1.Value = ""

ComboBox1.ListFillRange = "list!$A$1:$A$50"


End Sub
 
Son düzenleme:
Geri
Üst