• DİKKAT

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

CommandButtona şarta göre isim verme

Katılım
10 Ağustos 2004
Mesajlar
292
Excel Vers. ve Dili
Excel 2021 - Türkçe
Merhaba,
CommandButton1 şarta göre isim vermek istiyorum. Forma güncelle adında buton ekledim. Eğer TextBox1 boş ise kaydet değil ise güncelle olarak kalmasını istiyorum. Ama formu açtığımda kaydet geliyor güncelle olarak gözükmüyor.

If TextBox1 = "" Then
CommandButton1.Caption = "Kaydet"
CommandButton1.ForeColor = &H80000012
End If
 
Merhaba
Bu şekilde kullanabilirsiniz_?
Kod:
Option Explicit
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If TextBox1 <> Empty Then
CommandButton1.Caption = "Güncelle"
Else
CommandButton1.Caption = "Kaydet"
End If
End Sub
Private Sub UserForm_Initialize()
CommandButton1.Caption = "Kaydet"
End Sub
 
Geri
Üst