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

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

قام بنشر

السلام عليكم ورحمة الله وبركاته

الاخوة الافاضل

اتمنى حد يرد  علي الاقل السلام

يوجد كود نزلته من هذا المنتدى وعايز اطبقه عندى مش عارف افهمة

اتمنى حد يشرحه ليا

وجزاكم الله خيرا

الكـــــــــود

On Error GoTo 1
Dim LastR As Long
Dim SText As String
Dim StDate As Date
Dim EndDate As Date
Dim LastR1 As Long
Application.ScreenUpdating = False

Sheets("Aldata1").Range("b6:s10000").ClearContents

SText = Sheets("Aldata1").Range("U3")
StDate = Sheets("Aldata1").Range("W2")
EndDate = Sheets("Aldata1").Range("W3")
LastR1 = Sheets("add").Cells(Rows.Count, 2).End(xlUp).Row

If SText <> "" Then
Sheets("add").Range("b5:s" & LastR1).AutoFilter Field:=3, Criteria1:=SText
    Sheets("add").Range("b5:s" & LastR1).AutoFilter Field:=1, Criteria1:=">=" & Format(StDate, "yyyy/MM/dd"), Operator:=xlAnd, _
    Criteria2:="<=" & Format(EndDate, "yyyy/MM/dd")
LastR = Sheets("add").Cells(Rows.Count, 2).End(xlUp).Row
If LastR >= 6 Then
'
Sheets("add").Range("B5:S" & LastR).SpecialCells(xlCellTypeVisible).Copy
Sheets("Aldata1").Range("B6").PasteSpecial
Sheets("Aldata1").Range("A6").Select
Sheets("add").Range("b5:S4").AutoFilter
End If
Else
    If SText = "" Then
       Sheets("card").Range("b3:k" & LastR1).AutoFilter Field:=1, Criteria1:=">=" & Format(StDate, "yyyy/MM/dd"), Operator:=xlAnd, _
       Criteria2:="<=" & Format(EndDate, "yyyy/MM/dd")
       LastR = Sheets("card").Cells(Rows.Count, 2).End(xlUp).Row
       If LastR >= 4 Then
          Sheets("card").Range("C4:k" & LastR).SpecialCells(xlCellTypeVisible).Copy
          Sheets("كشف الحساب").Range("C7").PasteSpecial
          Sheets("كشف الحساب").Range("A7").Select
          Sheets("card").Range("b3:k3").AutoFilter
        End If
     End If
End If
Application.ScreenUpdating = True
1 End Sub

 

 

 

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