• DİKKAT

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

Spinbutton ile textboxda değer değiştirme

  • Konbuyu başlatan Konbuyu başlatan seddur
  • Başlangıç tarihi Başlangıç tarihi
Katılım
12 Nisan 2012
Mesajlar
533
Excel Vers. ve Dili
Microsoft office professional plus 2019
Merhaba.2022 - 2032 arası sayıları Textbox1 de göstermek ve spinbutton down ve up olayını kullanarak bu aralıktaki sayıları arttırmak veya azaltmak istiyorum.Yardımcı olursanız sevinirim.
 
Merhaba.
İsterseniz MsgBox uyarılarını silebilir ya da değiştirebilirsiniz.

C#:
Private Sub SpinButton1_SpinDown()
On Error Resume Next
    If Me.TextBox1.Value = 2022 Then
        MsgBox "2022 'den Az Olamaz"
        Exit Sub
    End If
    Me.TextBox1 = Me.TextBox1 - 1
End Sub

Private Sub SpinButton1_SpinUp()
On Error Resume Next
    If Me.TextBox1.Value = 2032 Then
        MsgBox "2032 'den Çok Olamaz"
        Exit Sub
    End If
    Me.TextBox1 = Me.TextBox1 + 1
End Sub

Private Sub UserForm_Initialize()
    Me.TextBox1.Value = "2022"
End Sub
 

Ekli dosyalar

Textbox1 userformda değil Sayfada.Bu durumda kodu nereye yazmalıyım?
 
Bu kısma yazabilirsiniz:

234787

C#:
Private Sub SpinButton1_SpinDown()
On Error Resume Next
    If Me.TextBox1.Value = 2022 Then
        MsgBox "2022 'den Az Olamaz"
        Exit Sub
    End If
    Me.TextBox1 = Me.TextBox1 - 1
End Sub

Private Sub SpinButton1_SpinUp()
On Error Resume Next
    If Me.TextBox1.Value = 2032 Then
        MsgBox "2032 'den Çok Olamaz"
        Exit Sub
    End If
    Me.TextBox1 = Me.TextBox1 + 1
End Sub

Private Sub Worksheet_Activate()
Me.TextBox1.Value = "2022"
End Sub
 

Ekli dosyalar

Geri
Üst