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

نقل بيانات من شيت لأخر حسب الحالة


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

السلام عليكم

حط الكود التالي في حدث Thisworkbook

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
           If Target.Column = 9 And Target.Row > 1 Then Ali Target
End Sub

والكود التالي في مودويل

Public Sub Ali(ByVal Tr As Range)
Dim A As String
Dim R As Range
Dim Sht As Worksheet
With Tr
On Error GoTo Nx
Set Sht = Sheets(.Text)
2
 With ActiveSheet.Range("A" & .Row & ":I" & .Row)
       .Copy
   With Sht
       .Cells(.Cells(.Rows.Count, 1).End(xlUp).Offset(1).Row, 1).PasteSpecial xlPasteValues
   End With
       .ClearContents
 End With
 Application.CutCopyMode = False
End With
Set Sht = Nothing: Set R = Nothing
Exit Sub
Nx:
Set Sht = Sheets("Main")
GoTo 2
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