Results 1 to 16 of 16

textbox and checkbox

Threaded View

  1. #1
    Registered User
    Join Date
    06-25-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    27

    textbox and checkbox

    I have a checkbox and multiple textbooks let say about 10.When the checkbox=true , i will be able to write data inside. if checkbox=false, it will be lock. THe code below work when only i click the button. How do i make it work immdiately upon when the checkbox=false?

    Private Sub CheckBox1_Click()
    
    If CheckBox1.Value = True Then
      TextBox1.Enabled = True
      Else
      TextBox1.Enabled = False
    End If
    
    If CheckBox1.Value = True Then
      TextBox2.Enabled = True
      Else
      TextBox2.Enabled = False
    End If
    
    If CheckBox1.Value = True Then
      TextBox3.Enabled = True
      Else
      TextBox3.Enabled = False
    End If
    
    If CheckBox1.Value = True Then
      TextBox4.Enabled = True
      Else
      TextBox4.Enabled = False
    End If
    
    End Sub
    
    
    Private Sub CommandButton1_Click()
    
    Sheet1.Range("E7").Value = TextBox1.Value
    Sheet1.Range("E8").Value = TextBox3.Value
    Sheet1.Range("E9").Value = TextBox5.Value
    Sheet1.Range("E10").Value = TextBox7.Value
    Sheet1.Range("E11").Value = TextBox9.Value
    Sheet1.Range("E7").Value = TextBox2.Value
    Sheet1.Range("E7").Value = TextBox4.Value
    Sheet1.Range("E7").Value = TextBox6.Value
    Sheet1.Range("E7").Value = TextBox8.Value
    Sheet1.Range("E7").Value = TextBox10.Value
    
    
    End Sub


    Go www.cashcrate.com/3866888 to earn cash online!!!
    Last edited by ngkj; 07-17-2012 at 05:16 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1