اذهب الي المحتوي
أوفيسنا
بحث مخصص من جوجل فى أوفيسنا
Custom Search

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

قام بنشر

اخي مجاهد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
قام بنشر

Right-click worksheet name and select View Code and paste the code I posted 

Back to the worksheet, type any month number (say 10) in cell S2 and press Enter key

  • 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