Tarihte yılın rakamlarını textboxlara ayırma

Katılım
21 Mart 2005
Mesajlar
200
Excel Vers. ve Dili
Ofiice 2013
arkadaşlar merhaba, Tarih te yıl bölümünü (örneğin 2009)un rakamlarını 4 adet textbox a yzdımak istiyorum. saygılar.
 

Ekli dosyalar

Necdet

Moderatör
Yönetici
Katılım
4 Haziran 2005
Mesajlar
15,491
Excel Vers. ve Dili
Ofis 365 Türkçe
Merhaba,

Kodları aşağıdaki şekilde kullanabilirsiniz.

Kod:
Private Sub SpinButton1_SpinDown()
TextBox1.Value = TextBox1.Value - 1
Degistir
End Sub
Kod:
Private Sub SpinButton1_SpinUp()
TextBox1.Value = TextBox1.Value + 1
Degistir
End Sub
Kod:
Private Sub UserForm_Initialize()
TextBox1.Value = Year(Date)
Degistir
End Sub
Kod:
Sub Degistir()
TextBox2.Value = Left(TextBox1.Value, 1)
TextBox3.Value = Mid(TextBox1.Value, 2, 1)
TextBox4.Value = Mid(TextBox1.Value, 3, 1)
TextBox5.Value = Right(TextBox1.Value, 1)
End Sub
 
Üst