أبوســـارة1973 قام بنشر نوفمبر 1, 2015 قام بنشر نوفمبر 1, 2015 تعديل الكود التالي حيث يوجد به خطا فيما يخص تحويل قيمة option Button Private Sub CommandButton1_Click()Dim r As Integer, lastrow As Long 'Sélectionner la feuille avant de compter son nombre de lignes Sheet4.Activate lastrow = DerniereLignePleine(1) + 1 'If ajout_code_employe.Value <> "" Then ' For i = 2 To lastrow - 1 Range("A" & lastrow) = TextBox1 Range("B" & lastrow) = TextBox6 Range("C" & lastrow) = ComboBox3 Range("D" & lastrow) = TextBox3 Range("E" & lastrow) = TextBox4 Range("F" & lastrow) = TextBox5 Range("G" & lastrow) = ComboBox1 Range("H" & lastrow) = ComboBox2 Range("I" & lastrow) = TextBox2 Range("J" & lastrow) = ComboBox4 Range("K" & lastrow) = ComboBox5 Range("L" & lastrow) = TextBox33 If OB1_1.Value = True Then Range("N" & lastrow) = 4 If OB1_2.Value = True Then Range("N" & lastrow) = 3 If OB1_3.Value = True Then Range("N" & lastrow) = 2 If OB1_4.Value = True Then Range("N" & lastrow) = 1 If OB2_1.Value = True Then Range("O" & lastrow) = 4 If OB2_2.Value = True Then Range("O" & lastrow) = 3 If OB2_3.Value = True Then Range("O" & lastrow) = 2 If OB2_4.Value = True Then Range("O" & lastrow) = 1 If OB3_1.Value = True Then Range("P" & lastrow) = 4 If OB3_2.Value = True Then Range("P" & lastrow) = 3 If OB3_3.Value = True Then Range("P" & lastrow) = 2 If OB3_4.Value = True Then Range("P" & lastrow) = 1 If OB4_1.Value = True Then Range("Q" & lastrow) = 4 If OB4_2.Value = True Then Range("Q" & lastrow) = 3 If OB4_3.Value = True Then Range("Q" & lastrow) = 2 If OB4_4.Value = True Then Range("Q" & lastrow) = 1 If OB5_1.Value = True Then Range("R" & lastrow) = 4 If OB5_2.Value = True Then Range("R" & lastrow) = 3 If OB5_3.Value = True Then Range("R" & lastrow) = 2 If OB5_4.Value = True Then Range("R" & lastrow) = 1 If OB6_1.Value = True Then Range("S" & lastrow) = 4 If OB6_2.Value = True Then Range("S" & lastrow) = 3 If OB6_3.Value = True Then Range("S" & lastrow) = 2 If OB6_4.Value = True Then Range("S" & lastrow) = 1 If OB7_1.Value = True Then Range("T" & lastrow) = 4 If OB7_2.Value = True Then Range("T" & lastrow) = 3 If OB7_3.Value = True Then Range("T" & lastrow) = 2 If OB7_4.Value = True Then Range("T" & lastrow) = 1 If OB8_1.Value = True Then Range("U" & lastrow) = 4 If OB8_2.Value = True Then Range("U" & lastrow) = 3 If OB8_3.Value = True Then Range("U" & lastrow) = 2 If OB8_4.Value = True Then Range("U" & lastrow) = 1 If OB9_1.Value = True Then Range("V" & lastrow) = 4 If OB9_2.Value = True Then Range("V" & lastrow) = 3 If OB9_3.Value = True Then Range("V" & lastrow) = 2 If OB9_4.Value = True Then Range("V" & lastrow) = 1 If OB10_1.Value = True Then Range("W" & lastrow) = 4 If OB10_2.Value = True Then Range("W" & lastrow) = 3 If OB10_3.Value = True Then Range("W" & lastrow) = 2 If OB10_4.Value = True Then Range("W" & lastrow) = 1 If OB11_1.Value = True Then Range("X" & lastrow) = 4 If OB11_2.Value = True Then Range("X" & lastrow) = 3 If OB11_3.Value = True Then Range("X" & lastrow) = 2 If OB11_4.Value = True Then Range("X" & lastrow) = 1 If OB12_1.Value = True Then Range("Y" & lastrow) = 4 If OB12_2.Value = True Then Range("Y" & lastrow) = 3 If OB12_3.Value = True Then Range("Y" & lastrow) = 2 If OB12_4.Value = True Then Range("Y" & lastrow) = 1 If OB13_1.Value = True Then Range("Z" & lastrow) = 4 If OB13_2.Value = True Then Range("Z" & lastrow) = 3 If OB13_3.Value = True Then Range("Z" & lastrow) = 2 If OB13_4.Value = True Then Range("Z" & lastrow) = 1 If OB14_1.Value = True Then Range("AA" & lastrow) = 4 If OB14_2.Value = True Then Range("AA" & lastrow) = 3 If OB14_3.Value = True Then Range("AA" & lastrow) = 2 If OB14_4.Value = True Then Range("AA" & lastrow) = 1 If OB15_1.Value = True Then Range("AB" & lastrow) = 4 If OB15_2.Value = True Then Range("AB" & lastrow) = 3 If OB15_3.Value = True Then Range("AB" & lastrow) = 2 If OB15_4.Value = True Then Range("AB" & lastrow) = 1 If OB16_1.Value = True Then Range("AC" & lastrow) = 4 If OB16_2.Value = True Then Range("AC" & lastrow) = 3 If OB16_3.Value = True Then Range("AC" & lastrow) = 2 If OB16_4.Value = True Then Range("AC" & lastrow) = 1 If OB17_1.Value = True Then Range("AD" & lastrow) = 4 If OB17_2.Value = True Then Range("AD" & lastrow) = 3 If OB17_3.Value = True Then Range("AD" & lastrow) = 2 If OB17_4.Value = True Then Range("AD" & lastrow) = 1 If OB18_1.Value = True Then Range("AE" & lastrow) = 4 If OB18_2.Value = True Then Range("AE" & lastrow) = 3 If OB18_3.Value = True Then Range("AE" & lastrow) = 2 If OB18_4.Value = True Then Range("AE" & lastrow) = 1 If OB19_1.Value = True Then Range("AF" & lastrow) = 4 If OB19_2.Value = True Then Range("AF" & lastrow) = 3 If OB19_3.Value = True Then Range("AF" & lastrow) = 2 If OB19_4.Value = True Then Range("AF" & lastrow) = 1 If OB20_1.Value = True Then Range("AG" & lastrow) = 4 If OB20_2.Value = True Then Range("AG" & lastrow) = 3 If OB20_3.Value = True Then Range("AG" & lastrow) = 2 If OB20_4.Value = True Then Range("AG" & lastrow) = 1 If OB21_1.Value = True Then Range("AH" & lastrow) = 4 If OB21_2.Value = True Then Range("AH" & lastrow) = 3 If OB21_3.Value = True Then Range("AH" & lastrow) = 2 If OB21_4.Value = True Then Range("AH" & lastrow) = 1 If OB22_1.Value = True Then Range("AI" & lastrow) = 4 If OB22_2.Value = True Then Range("AI" & lastrow) = 3 If OB22_3.Value = True Then Range("AI" & lastrow) = 2 If OB22_4.Value = True Then Range("AI" & lastrow) = 1 If OB23_1.Value = True Then Range("AJ" & lastrow) = 4 If OB23_2.Value = True Then Range("AJ" & lastrow) = 3 If OB23_3.Value = True Then Range("AJ" & lastrow) = 2 If OB23_4.Value = True Then Range("AJ" & lastrow) = 1 If OB24_1.Value = True Then Range("AK" & lastrow) = 4 If OB24_2.Value = True Then Range("AK" & lastrow) = 3 If OB24_3.Value = True Then Range("AK" & lastrow) = 2 If OB24_4.Value = True Then Range("AK" & lastrow) = 1 If OB25_1.Value = True Then Range("AL" & lastrow) = 4 If OB25_2.Value = True Then Range("AL" & lastrow) = 3 If OB25_3.Value = True Then Range("AL" & lastrow) = 2 If OB25_4.Value = True Then Range("AL" & lastrow) = 1 If OB26_1.Value = True Then Range("AM" & lastrow) = 4 If OB26_2.Value = True Then Range("AM" & lastrow) = 3 If OB26_3.Value = True Then Range("AM" & lastrow) = 2 If OB26_4.Value = True Then Range("AM" & lastrow) = 1 If OB27_1.Value = True Then Range("AN" & lastrow) = 4 If OB27_2.Value = True Then Range("AN" & lastrow) = 3 If OB27_3.Value = True Then Range("AN" & lastrow) = 2 If OB27_4.Value = True Then Range("AN" & lastrow) = 1 If OB28_1.Value = True Then Range("AO" & lastrow) = 4 If OB28_2.Value = True Then Range("AO" & lastrow) = 3 If OB28_3.Value = True Then Range("AO" & lastrow) = 2 If OB28_4.Value = True Then Range("AO" & lastrow) = 1 If OB29_1.Value = True Then Range("AP" & lastrow) = 4 If OB29_2.Value = True Then Range("AP" & lastrow) = 3 If OB29_3.Value = True Then Range("AP" & lastrow) = 2 If OB29_4.Value = True Then Range("AP" & lastrow) = 1 If OB30_1.Value = True Then Range("AQ" & lastrow) = 4 If OB30_2.Value = True Then Range("AQ" & lastrow) = 3 If OB30_3.Value = True Then Range("AQ" & lastrow) = 2 If OB30_4.Value = True Then Range("AQ" & lastrow) = 1 If OB31_1.Value = True Then Range("AR" & lastrow) = 4 If OB31_2.Value = True Then Range("AR" & lastrow) = 3 If OB31_3.Value = True Then Range("AR" & lastrow) = 2 If OB31_4.Value = True Then Range("AR" & lastrow) = 1 ' For r = 0 To 8 'Me.Controls(myCon(r)) = ""'NexT MsgBox Prompt:="ÊãÊ ÚãáíÉ ÅÖÇÝÉ ãæÙÝ ÌÏíÏ ÈäÌÇÍ", Title:="ÑÓÇáÉ ÊÃßíÏ" OB1_1.Value = False OB1_2.Value = False OB1_3.Value = False OB1_4.Value = False' OB2_1.Value = False 'OB2_2.Value = False 'OB2_3.Value = False 'OB2_4.Value = False 'OB3_1.Value = False 'OB3_2.Value = False 'OB3_3.Value = False 'OB3_4.Value = False 'OB4_1.Value = False 'OB4_2.Value = False 'OB4_3.Value = False 'OB4_4.Value = False End Sub المطلوب في هذا الكود هو ترحيل قيمة الأوبشن بوتن ( option Button) بحيث إذا تم ختيار الأول من المجموعة الأولى يعطي رقم 4 في الخلية المحددة والثاني يعطي 3 والثالث يعطي قيمة 2 والأخير يعطية قيمة 1 وهكذا فب بقية المجموعات
ياسر خليل أبو البراء قام بنشر نوفمبر 1, 2015 قام بنشر نوفمبر 1, 2015 أخي الكريم هلا أرفقت ملف لتيسير تقديم المساعدة
الردود الموصى بها
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.