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

كود نقل اصفف على حسب اسم الشهر


إذهب إلى أفضل إجابة Solved by سليم حاصبيا,

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

  • أفضل إجابة

<رب هذا الملف

Sub each_row_to_Its_sheet()
Dim lr, i, x
Dim sh As Worksheet
Sheets("jan").Range("a2").CurrentRegion.Offset(1).ClearContents
Sheets("Feb").Range("a2").CurrentRegion.Offset(1).ClearContents
Sheets("Mar").Range("a2").CurrentRegion.Offset(1).ClearContents
With Sheets("Legal")
lr = .Cells(Rows.Count, 1).End(3).Row
 For i = 3 To lr
 If Not IsDate(.Cells(i, 2)) Then GoTo next_i
  Select Case Month(.Cells(i, 2))
   Case 1: Set sh = Sheets("jan")
   Case 2: Set sh = Sheets("Feb")
   Case 3: Set sh = Sheets("Mar")
   Case Else: GoTo next_i
  End Select
   x = sh.Cells(Rows.Count, 1).End(3).Row + 1
    sh.Cells(x, 1).Resize(, 5).Value = _
    .Cells(i, 1).Resize(, 5).Value
next_i:
 Next i
End With
End Sub

الملف مرفق

Naser.xlsm

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

  • تصفح هذا الموضوع مؤخراً   0 اعضاء متواجدين الان

    • لايوجد اعضاء مسجلون يتصفحون هذه الصفحه
×
×
  • اضف...

Important Information