• DİKKAT

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

Userformda Tarih

Katılım
17 Ağustos 2004
Mesajlar
222
Excel Vers. ve Dili
Ofiste Excel 2000 Türkçe
Evde Excel 2003 Türkçe
Merhabalar
ComboBox1 de yılı ComboBox2 de ayı seçtiğimizde ayın günlerini TextBoxlara sıralatabilirmiyiz?İyiçalışmalar. :yardim:
 
hangi textbox lara? minimum 31 tane text box olması gerekiyor. boyle bir sey mi istediginiz?
 
Evet 31 tane TextBox.
 
combo1 de yıllar
combo2 de aylar (1,2,...12)
31 tanede textbox oldugunu varsaydim.

Kod:
Private Sub ComboBox2_Change()
If ComboBox2 = 12 Then
    x = DateDiff("d", "1" & "." & ComboBox2 & "." & ComboBox1, "1" & "." & "1" & "." & ComboBox1 + 1)
Else
    x = DateDiff("d", "1" & "." & ComboBox2 & "." & ComboBox1, "1" & "." & ComboBox2 + 1 & "." & ComboBox1)
End If
z = 1
Dim ctrl As Control
    For Each ctrl In UserForm1.Controls
        If TypeName(ctrl) = "TextBox" Then
            ctrl.Text = ""
        End If
    Next ctrl
    For Each ctrl In UserForm1.Controls
        If TypeName(ctrl) = "TextBox" Then
            
            ctrl.Text = z
            If z = x Then Exit For
            z = z + 1
        End If
    Next ctrl
End Sub
 
Teşekkürler.İyiçalışmalar
 
Geri
Üst