none
Disable Button when i enter data in a textbox !! ? RRS feed

  • Question

  • hi 

    i wanna to create a form  (  in Excel )  that when i enter data in a textbox  on the form

    some of button in form going to disable state 

    is it possible  ?? 

     

    Monday, November 26, 2012 2:07 PM

All replies

  • Yes it is.

    Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
    CommandButton1.Enabled = False
    End Sub
    


    Oskar Shon, Office System MVP

    Press if Helpful; Answer when a problem solved

    Monday, November 26, 2012 7:29 PM
    Answerer
  • Thanks Oskar Shon 

    ....>>>>>>>>>>>>>>>>>>

    best regards . Mahdi Hassani

    Monday, November 26, 2012 7:37 PM
  • You can modyf one line:

    if len(TextBox1.text)>0 then commandbutton1.enabled =false

    To by sure that on exit you've some data


    Oskar Shon, Office System MVP

    Press if Helpful; Answer when a problem solved

    Monday, November 26, 2012 10:13 PM
    Answerer
  • Thank you so much 
    Friday, November 30, 2012 4:44 PM