• DİKKAT

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

Birden fazla textbox'un change özelliği için kod

gezgin-49

Altın Üye
Katılım
17 Ekim 2006
Mesajlar
669
Excel Vers. ve Dili
Türkçe 2003
sayın üstadlarım textbox1'den textbox25'e kadar olan textboxların change özelliğini tarih formatına çevirmek istiyorum,
Kod:
Private Sub TextBox1_Change()

If Len(TextBox1) = 1 Then
     If Mid(TextBox1, 1, 1) > 3 Then
         MsgBox "0 ile 3 arasında Bir Rakkam Giriniz.!!!"
         TextBox1 = ""
     End If
End If

If Len(TextBox1) = 4 Then
     If Mid(TextBox1, 4, 1) > 1 Then
         MsgBox "0 ile 1 arasında Bir Rakkam Giriniz.!!!"
         TextBox1 = Trim(WorksheetFunction.Substitute(TextBox1, Right(TextBox1, 1), ""))
     End If
End If

If UserForm1.TextBox1 <> "" Then
If Len(TextBox1) = 2 Then
TextBox1 = Format(TextBox1, "0#"".")
End If
If Len(TextBox1) = 5 Then
TextBox1 = Format(TextBox1, "0#"".""##"".")
End If
If Len(TextBox1) = 10 Then
TextBox1 = Format(TextBox1, "0#"".""##"".""####")
End If
End If
End Sub

her textbox için ayrı ayrı yapıyorum çok yer kaplıyor, bunun kısa yolu yok mu
 
Merhaba.
Class Module konusunu araştırınız.
 
Geri
Üst