جرب الكود التالي وإن كنت لا أدري شكل النتائج المتوقعة
Private Sub CommandButton1_Click()
With ورقة1
.Range("d10") = TextBox9.Value
.Range("f10") = TextBox10.Value
.Range("d13") = TextBox1.Value
.Range("d14") = TextBox2.Value
.Range("d15") = TextBox3.Value
.Range("d16") = TextBox4.Value
.Range("d17") = TextBox5.Value
.Range("d18") = TextBox6.Value
.Range("d19") = TextBox7.Value
.Range("d20") = TextBox8.Value
.Activate
.PrintOut From:=1, To:=1, Copies:=2, Collate:=True, IgnorePrintAreas:=False
End With
Sheets("يناير").Activate
x = Cells(6, 10).End(xlToLeft).Column
Cells(6, x + 1).Offset(0, 1).Value = TextBox1.Value
Cells(7, x + 1).Offset(0, 3).Value = TextBox2.Value
Cells(8, x + 1).Offset(0, 5).Value = TextBox3.Value
Cells(9, x + 1).Offset(0, 7).Value = TextBox4.Value
TextBox1.Value = ""
TextBox2.Value = ""
TextBox3.Value = ""
TextBox4.Value = ""
TextBox5.Value = ""
TextBox6.Value = ""
TextBox7.Value = ""
TextBox8.Value = ""
TextBox9.Value = ""
TextBox10.Value = ""
End Sub
إذا لم يؤدي الكود الغرض يرجى إرفاق الملف مرة أخرى وبه شكل النتائج المتوقعة ليسهل تقديم المساعدة من قبل إخوانك بالمنتدى
تقبل تحياتي