Hello. I'm a newbie here. I really need help to create survey using excel 2010.
I have 3 choices for users to choose from; 2 checkboxes, and 1 cell which allow them to key in only whole numbers from 1-100. They can only select 1 choice out of the 3.
What I need is that;
1. They can keys in number only if they don't select any checkboxes.
2. If they select one of the checkbox, the other checkbox will be unchecked automatically and the number that they may key in earlier, need to be erase. Or if they've already checked one of the checkbox and decide to key in number later, it'll either show the message to not allow them to key in number or the checked checkbox will be automaticallly unchecked, whichever works is fine for me.
3. It should work like this for all other rows as well.
I tried to work with this for two days now. I can write vb a little bit, but the codes didn't work with excel. And I don't know why when I create codes in excel, it show message that macro is disabled on the file, while I have enabled macros for the file already.
So, I need help with both how to write the codes and also how to makes it works on excel file as well. I have attached the example of the file I'm working on too.
I hope my question is clear and that someone can help me. Thank you very much for your time.
PS. This is the code I write with VB, it works fine there but didn't work with excel.
Public Class Form1
Private Sub CheckBox1_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles CheckBox1.CheckedChanged
If CheckBox1.CheckState = CheckState.Checked Then
CheckBox2.CheckState = CheckState.Unchecked
TextBox1.Clear()
End If
End Sub
Private Sub CheckBox2_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles CheckBox2.CheckedChanged
If CheckBox2.CheckState = CheckState.Checked Then
CheckBox1.CheckState = CheckState.Unchecked
TextBox1.Clear()
End If
End Sub
End Class
Bookmarks