saffar قام بنشر مارس 9, 2023 مشاركة قام بنشر مارس 9, 2023 السلام عليكم هل بالامكان البحث عن رقم طالب ونسخ السطر لشيت ثاني حبذا يكون تصفية عند الكتابة في البحث stfile.xlsx رابط هذا التعليق شارك More sharing options...
أفضل إجابة lionheart قام بنشر مارس 9, 2023 أفضل إجابة مشاركة قام بنشر مارس 9, 2023 In worksheet module, paste the following code Private Sub Worksheet_Change(ByVal Target As Range) Dim x, m As Long If Target.Address = "$E$2" Then If Target.Value = Empty Then Exit Sub x = Application.Match(Val(Target.Value), Columns(1), 0) If Not IsError(x) Then With Sheets("Copied") m = .Cells(Rows.Count, 1).End(xlUp).Row + 1 Rows(x).Copy .Cells(m, 1) End With MsgBox "Row " & x & " Copied Successfully", 64 Else MsgBox "No Found", vbExclamation: Exit Sub End If End If End Sub 2 1 رابط هذا التعليق شارك More sharing options...
saffar قام بنشر مارس 9, 2023 الكاتب مشاركة قام بنشر مارس 9, 2023 شكرا اخي Lionheart تظهر رسالة No Found رابط هذا التعليق شارك More sharing options...
lionheart قام بنشر مارس 9, 2023 مشاركة قام بنشر مارس 9, 2023 You should write a number from column A in cell E2 The code is working fine on my side رابط هذا التعليق شارك More sharing options...
saffar قام بنشر مارس 9, 2023 الكاتب مشاركة قام بنشر مارس 9, 2023 رابط هذا التعليق شارك More sharing options...
حسونة حسين قام بنشر مارس 10, 2023 مشاركة قام بنشر مارس 10, 2023 وعليكم السلام ورحمة الله وبركاته عدل هذا السطر Application.Match(Val(Target.Value), Columns(1), 0) الى Application.Match(Val(Target.Value), Columns(4), 0) 3 رابط هذا التعليق شارك More sharing options...
lionheart قام بنشر مارس 10, 2023 مشاركة قام بنشر مارس 10, 2023 Thanks a lot my dear Hassona for sharing 1 رابط هذا التعليق شارك More sharing options...
saffar قام بنشر مارس 10, 2023 الكاتب مشاركة قام بنشر مارس 10, 2023 نعم تم التعديل للعمود واشتغل الكود في السؤال طلبت ( حبذا يكون تصفية للسطر عند الكتابة في البحث ونسخة مما يقلل الخطأ) اذا ما في امكانية لا مشكلة رابط هذا التعليق شارك More sharing options...
lionheart قام بنشر مارس 10, 2023 مشاركة قام بنشر مارس 10, 2023 No need to apply filter as the code will search the student number and copy the related row. Also there is a message box that shows you the number of row that is copied رابط هذا التعليق شارك More sharing options...
saffar قام بنشر مارس 10, 2023 الكاتب مشاركة قام بنشر مارس 10, 2023 الكود يعمل بشكل صحيح ما قصدته ان بعد التصفية يتبقى السطر الذي فيه الرقم والاسم قبل الضغط على زر الرجوع زيادة تاكيد اذا امكن التعديل اكون لك شاكر رابط هذا التعليق شارك More sharing options...
lionheart قام بنشر مارس 11, 2023 مشاركة قام بنشر مارس 11, 2023 If you deal with macros, there is no UNDO. So you can't undo the action. If you type a wrong student number you have to close the file without saving the changes رابط هذا التعليق شارك More sharing options...
الردود الموصى بها
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.