Soru textbox boş ise sıfır yazma

sirkülasyon

Altın Üye
Katılım
10 Temmuz 2012
Mesajlar
2,552
Excel Vers. ve Dili
2021 LTSC TR
Kod:
For Each nesne In Controls
If TypeName(nesne) = "TextBox" Then
If nesne.Value = "" Then
nesne.Value = 0
End If
End If
Next

ustam yukarıdaki kod ile tüm textboxlar sıfır oluyor. Tüm textbox yerine sadece 7 - 11 textbox arası sıfır olabilmesi için yardımcı olabilir misiniz?
 
Merhaba,

Deneyiniz.
Kod:
For i = 7 To 11
    If Controls("TextBox" & i) = "" Then
        Controls("TextBox" & i) = 0
    End If
Next i
 
Geri
Üst