'목록하단 광고 치환자(withSeok)
728x90
특정셀과 같은 값을 가지는 행만 보이고
나머지 행은 모두 숨기기

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Private Sub Worksheet_Change(ByVal Target As Range)
    
If Not Target.Address = "$T$2" Then Exit Sub
 
 
   'Application.EnableEvents = False
 
Dim banVal
    banVal = Range("$T$2").Value
 
Dim rng As Range
Dim rngD As Range
 
    If banVal <> "" Then
        For i = 3 To 842
            Rows("3:842").EntireRow.Hidden = True
            If Range("w" & i) = banVal Then
                If rngD Is Nothing Then
                    Set rngD = Range("W" & i)
                    'rngD.Select
                        '단계별 확인 때 사용
                Else
                    Set rngD = Union(rngD, Range("W" & i))
                    'rngD.Select
                        '단계별 확인 때 사용
                End If
            Else
            End If
        Next
    Else
    End If
 
    rngD.EntireRow.Hidden = False
 
   'Application.EnableEvents = True ' 이벤트가 발생되면 작동합니다
 
End Sub
 
 
cs
728x90

+ Recent posts