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

تصفية حسب الشهر


إذهب إلى أفضل إجابة Solved by مجاهد2013,

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

اخي مجاهد2013

تفضل تصفية.xls

الكود المستخدم

Private Sub Worksheet_SelectionChange(ByVal X As Range)
Dim sw As Long
sw = Range("S2:S2000").End(xlUp).Row
    If [s2] <> "" Then
        Selection.AutoFilter
        Range("S2:S2000" & sw).AutoFilter Field:=1, Criteria1:= _
            "=" & [s2] & "*", Operator:=xlOr
    Else
        Range("S2:S2000" & sw).AutoFilter Field:=1
    End If
End Sub

 

رابط هذا التعليق
شارك

In worksheet module put the following code (but it is better to depend on another cell in the first two columns a way from S2)

Private Sub Worksheet_Change(ByVal Target As Range)
    Dim myMonth, c As Long
    If Target.Address = "$S$2" Then
        Application.ScreenUpdating = False
        myMonth = Target.Value
        Columns("C:KX").Hidden = True
        For c = 3 To 310
            With Cells(5, c)
                If .Value2 <> "" And Month(.Value2) = myMonth Then
                    .EntireColumn.Hidden = False
                End If
            End With
        Next c
        Application.ScreenUpdating = True
    End If
End Sub

 

  • Like 2
رابط هذا التعليق
شارك

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