اذهب الي المحتوي
أوفيسنا

الردود الموصى بها

قام بنشر

السلام عليكم،

عندي 3 مجموعات Checkboxes في كل مجموعة 4 Checkbox  ملف اكسل.

اريد في كل مجموعة ان يكون اختيار  checkbox واحد

واخيرا في Checkbox منفرد اسمه Clear اريد ان تلغى كل الاختيارات السابقة.

ارجو المساعدة

Checkbox.xlsx

قام بنشر

ما دام المطلوب اختيار واحد فقط
يمكنك استعمال option button وليس checkbox 

هذه أساسيات البرمجة 

ولحذف تحديد الخيرات يمكن استعمال كود يجعل قيمة الخلية المرتبطة بأزرار السؤال تساوي فراغ أو صفر

بالتوفيق

  • أفضل إجابة
قام بنشر

السلام عليكم ورحمه الله وبركاته

اتفضل لعله المطلوب



Private Sub CheckBox1_Click()
If CheckBox1 = True Then
CheckBox2 = False
CheckBox3 = False
CheckBox4 = False
[c4] = " True"
[d4] = " False"
[e4] = " False"
[f4] = " False"
Else
End If
End Sub

Private Sub CheckBox13_Click()
If CheckBox13 = True Then
CheckBox1 = False
CheckBox2 = False
CheckBox3 = False
CheckBox4 = False
CheckBox5 = False
CheckBox6 = False
CheckBox7 = False
CheckBox8 = False
CheckBox9 = False
CheckBox10 = False
CheckBox11 = False
CheckBox12 = False

[c4] = " False"
[c9] = " False"
[c14] = " False"

[d4] = " False"
[d9] = " False"
[d14] = " False"

[e4] = " False"
[e9] = " False"
[e14] = " False"

[f4] = " False"
[f9] = " False"
[f14] = " False"

Else

'[c4] = " "
'[c9] = " "
'[c14] = " "
'
'[d4] = " "
'[d9] = " "
'[d14] = " "
'
'[e4] = " "
'[e9] = " "
'[e14] = " "
'
'[f4] = " "
'[f9] = " "
'[f14] = " "

End If

End Sub

Private Sub CheckBox2_Click()

If CheckBox2 = True Then
CheckBox1 = False
CheckBox3 = False
CheckBox4 = False
[c4] = " False"
[d4] = " True"
[e4] = " False"
[f4] = " False"
Else
End If

End Sub

Private Sub CheckBox3_Click()

If CheckBox3 = True Then
CheckBox2 = False
CheckBox1 = False
CheckBox4 = False
[c4] = " False"
[d4] = " False"
[e4] = " True"
[f4] = " False"
Else
End If

End Sub

Private Sub CheckBox4_Click()

If CheckBox4 = True Then
CheckBox2 = False
CheckBox3 = False
CheckBox1 = False
[c4] = " True"
[d4] = " False"
[e4] = " False"
[f4] = " True"
Else
End If

End Sub

Private Sub CheckBox5_Click()
If CheckBox5 = True Then
CheckBox6 = False
CheckBox7 = False
CheckBox8 = False
[c9] = " True"
[d9] = " False"
[e9] = " False"
[f9] = " False"
Else
End If
End Sub

Private Sub CheckBox6_Click()
If CheckBox6 = True Then
CheckBox5 = False
CheckBox7 = False
CheckBox8 = False
[d9] = " True"
[c9] = " False"
[e9] = " False"
[f9] = " False"
Else
End If
End Sub

Private Sub CheckBox7_Click()
If CheckBox7 = True Then
CheckBox5 = False
CheckBox6 = False
CheckBox8 = False
[e9] = " True"
[d9] = " False"
[c9] = " False"
[f9] = " False"
Else
End If
End Sub

Private Sub CheckBox8_Click()
If CheckBox8 = True Then
CheckBox5 = False
CheckBox6 = False
CheckBox7 = False
[c9] = " False"
[d9] = " False"
[e9] = " False"
[f9] = " True"
Else
End If
End Sub

Private Sub CheckBox9_Click()
If CheckBox9 = True Then
CheckBox10 = False
CheckBox11 = False
CheckBox12 = False
[c14] = " True"
[d14] = " False"
[e14] = " False"
[f14] = " False"
Else
End If
End Sub

Private Sub CheckBox10_Click()
If CheckBox10 = True Then
CheckBox9 = False
CheckBox11 = False
CheckBox12 = False
[d14] = " True"
[c14] = " False"
[e14] = " False"
[f14] = " False"
Else
End If
End Sub

Private Sub CheckBox11_Click()
If CheckBox11 = True Then
CheckBox9 = False
CheckBox10 = False
CheckBox12 = False
[f14] = " False"
[d14] = " False"
[c14] = " False"
[e14] = " True"
Else
End If
End Sub

Private Sub CheckBox12_Click()
If CheckBox12 = True Then
CheckBox9 = False
CheckBox10 = False
CheckBox11 = False
[c14] = " False"
[d14] = " False"
[e14] = " False"
[f14] = " True"
Else
End If
End Sub

Checkbox1.xlsm

  • Like 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

زائر
اضف رد علي هذا الموضوع....

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • تصفح هذا الموضوع مؤخراً   0 اعضاء متواجدين الان

    • لايوجد اعضاء مسجلون يتصفحون هذه الصفحه
×
×
  • اضف...

Important Information