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

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

قام بنشر

اخوتي العزاء السلام عليكم

ارجو تعديل هذا الكود لنه يقوم بترحيل هذا الجزء فقط 

Private Sub CommandButton1_Click()
If Me.ComboBox1.Value = "" Or Me.TextBox1.Value = "" Or Me.TextBox2.Value = "" Or Me.TextBox3.Value = "" Then: MsgBox "íÑÌì ÇÏÎÇá ßá ÇáÈíÇäÇÊ ÇæáÇ", , "ÝÇÖá ÇáÈÇæí": Exit Sub
Dim ws As Worksheet
Dim iRow As Long
Set ws = Sheets("Sheet2")
iRow = ws.Cells(Rows.Count, 1).End(xlUp).Row + 1
ws.Cells(iRow, 2).Value = Me.TextBox4.Value
ws.Cells(iRow, 4).Value = Me.TextBox1.Value
ws.Cells(iRow, 6).Value = Me.ComboBox1.Value
ws.Cells(iRow, 8).Value = Me.ComboBox2.Value
ws.Cells(iRow, 10).Value = Me.ComboBox2.Value
ws.Cells(iRow, 12).Value = Me.TextBox2.Value
ws.Cells(iRow, 34).Value = Me.TextBox3.Value
ws.Cells(iRow, 1).Value = Me.Label59
 

ويهمل المتبقي مثل

ws.Cells(iRow, 14).Value = Me.ComboBox4.Value
ws.Cells(iRow, 16).Value = Me.ComboBox17.Value
ws.Cells(iRow, 18).Value = Me.ComboBox18.Value
ws.Cells(iRow, 20).Value = Me.ComboBox19.Value
ws.Cells(iRow, 22).Value = Me.ComboBox20.Value
ws.Cells(iRow, 24).Value = Me.ComboBox21.Value
ws.Cells(iRow, 26).Value = Me.ComboBox22.Value
ws.Cells(iRow, 28).Value = Me.ComboBox23.Value
ws.Cells(iRow, 30).Value = Me.ComboBox24.Value
ws.Cells(iRow, 32).Value = Me.ComboBox25.Value

ارجو من حظرتكم الحل ان شاء الله

مع الشكر

1برنامج تنسيب.rar

قام بنشر

أخي الكريم مهند محسن

جرب التعديل التالي عله يفي بالغرض

Private Sub CommandButton1_Click()
    Dim ws As Worksheet
    Dim iRow As Long

    If Me.ComboBox1.Value = "" Or Me.TextBox1.Value = "" Or Me.TextBox2.Value = "" Or Me.TextBox3.Value = "" Then: MsgBox "يرجى ادخال كل البيانات اولا", , "فاضل الباوي": Exit Sub
    Set ws = Sheets("Sheet2")
    iRow = ws.Cells(Rows.Count, 1).End(xlUp).Row + 1

    Application.ScreenUpdating = False
    Application.Calculation = xlManual

        ws.Cells(iRow, 2).Value = Me.TextBox4.Value
        ws.Cells(iRow, 4).Value = Me.TextBox1.Value
        ws.Cells(iRow, 6).Value = Me.ComboBox1.Value
        ws.Cells(iRow, 8).Value = Me.ComboBox2.Value
        ws.Cells(iRow, 10).Value = Me.ComboBox3.Value
        ws.Cells(iRow, 12).Value = Me.TextBox2.Value
        ws.Cells(iRow, 34).Value = Me.TextBox3.Value
        ws.Cells(iRow, 1).Value = Me.Label59
    
        If Me.Frame1.Visible = True Then
            ws.Cells(iRow, 14).Value = Me.Frame1.ComboBox4.Value
            ws.Cells(iRow, 16).Value = Me.Frame1.ComboBox17.Value
            ws.Cells(iRow, 18).Value = Me.Frame1.ComboBox18.Value
            ws.Cells(iRow, 20).Value = Me.Frame1.ComboBox19.Value
            ws.Cells(iRow, 22).Value = Me.Frame1.ComboBox20.Value
            ws.Cells(iRow, 24).Value = Me.Frame1.ComboBox21.Value
            ws.Cells(iRow, 26).Value = Me.Frame1.ComboBox22.Value
            ws.Cells(iRow, 28).Value = Me.Frame1.ComboBox23.Value
            ws.Cells(iRow, 30).Value = Me.Frame1.ComboBox24.Value
            ws.Cells(iRow, 32).Value = Me.Frame1.ComboBox25.Value
        ElseIf Me.Frame2.Visible = True Then
            ws.Cells(iRow, 14).Value = Me.Frame2.ComboBox5.Value
            ws.Cells(iRow, 16).Value = Me.Frame2.ComboBox8.Value
            ws.Cells(iRow, 18).Value = Me.Frame2.ComboBox9.Value
            ws.Cells(iRow, 20).Value = Me.Frame2.ComboBox10.Value
            ws.Cells(iRow, 22).Value = Me.Frame2.ComboBox11.Value
            ws.Cells(iRow, 24).Value = Me.Frame2.ComboBox12.Value
            ws.Cells(iRow, 26).Value = Me.Frame2.ComboBox13.Value
            ws.Cells(iRow, 28).Value = Me.Frame2.ComboBox14.Value
            ws.Cells(iRow, 30).Value = Me.Frame2.ComboBox15.Value
            ws.Cells(iRow, 32).Value = Me.Frame2.ComboBox16.Value
        ElseIf Me.Frame4.Visible = True Then
            ws.Cells(iRow, 14).Value = Me.Frame4.ComboBox7.Value
            ws.Cells(iRow, 16).Value = Me.Frame4.ComboBox36.Value
            ws.Cells(iRow, 18).Value = Me.Frame4.ComboBox37.Value
            ws.Cells(iRow, 20).Value = Me.Frame4.ComboBox38.Value
            ws.Cells(iRow, 22).Value = Me.Frame4.ComboBox39.Value
            ws.Cells(iRow, 24).Value = Me.Frame4.ComboBox40.Value
            ws.Cells(iRow, 26).Value = Me.Frame4.ComboBox41.Value
            ws.Cells(iRow, 28).Value = Me.Frame4.ComboBox42.Value
            ws.Cells(iRow, 30).Value = Me.Frame4.ComboBox43.Value
            ws.Cells(iRow, 32).Value = Me.Frame4.ComboBox44.Value
        ElseIf Me.Frame3.Visible = True Then
            ws.Cells(iRow, 14).Value = Me.Frame3.ComboBox35.Value
            ws.Cells(iRow, 16).Value = Me.Frame3.ComboBox34.Value
            ws.Cells(iRow, 18).Value = Me.Frame3.ComboBox33.Value
            ws.Cells(iRow, 20).Value = Me.Frame3.ComboBox32.Value
            ws.Cells(iRow, 22).Value = Me.Frame3.ComboBox31.Value
            ws.Cells(iRow, 24).Value = Me.Frame3.ComboBox30.Value
            ws.Cells(iRow, 26).Value = Me.Frame3.ComboBox29.Value
            ws.Cells(iRow, 28).Value = Me.Frame3.ComboBox28.Value
            ws.Cells(iRow, 30).Value = Me.Frame3.ComboBox27.Value
            ws.Cells(iRow, 32).Value = Me.Frame3.ComboBox26.Value
        End If
    
        Me.TextBox1.Value = ""
        Me.ComboBox2.Value = ""
        Me.ComboBox3.Value = ""
        Me.TextBox2.Value = ""
        Me.TextBox3.Value = ""
        Me.ComboBox1 = ""
        Me.ComboBox4.Value = ""
        Me.ComboBox17.Value = ""
        Me.ComboBox18.Value = ""
        Me.ComboBox19.Value = ""
        Me.ComboBox20.Value = ""
        Me.ComboBox21.Value = ""
        Me.ComboBox22.Value = ""
        Me.ComboBox23.Value = ""
        Me.ComboBox24.Value = ""
        Me.ComboBox25.Value = ""
        Me.ComboBox5.Value = ""
        Me.ComboBox8.Value = ""
        Me.ComboBox9.Value = ""
        Me.ComboBox10.Value = ""
        Me.ComboBox11.Value = ""
        Me.ComboBox12.Value = ""
        Me.ComboBox13.Value = ""
        Me.ComboBox14.Value = ""
        Me.ComboBox15.Value = ""
        Me.ComboBox16.Value = ""
    
        Me.ComboBox7.Value = ""
        Me.ComboBox36.Value = ""
        Me.ComboBox37.Value = ""
        Me.ComboBox38.Value = ""
        Me.ComboBox39.Value = ""
        Me.ComboBox40.Value = ""
        Me.ComboBox41.Value = ""
        Me.ComboBox42.Value = ""
        Me.ComboBox43.Value = ""
        Me.ComboBox44.Value = ""
    
        Me.ComboBox35.Value = ""
        Me.ComboBox34.Value = ""
        Me.ComboBox33.Value = ""
        Me.ComboBox32.Value = ""
        Me.ComboBox31.Value = ""
        Me.ComboBox30.Value = ""
        Me.ComboBox29.Value = ""
        Me.ComboBox28.Value = ""
        Me.ComboBox27.Value = ""
        Me.ComboBox26.Value = ""

    Application.ScreenUpdating = True
    Application.Calculation = xlAutomatic

    MsgBox "تم الترحيل بنجاح"
    Lr = Sheets("Sheet2").Cells(Rows.Count, 1).End(xlUp).Row
    Me.TextBox4 = Application.WorksheetFunction.Max(Sheets("Sheet2").Range("B9:B" & Lr)) + 1
End Sub

تقبل تحياتي

 

  • 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.

×
×
  • اضف...

Important Information