|
|
|
|
|
|
Private Sub Worksheet_Change(ByVal Target As Range)
' Stop
'찾는 셀
If Target.Address(False, False) <> "G3" Then Exit Sub
' 데이타 범위
Dim rngX As Range: Set rngX = Range("K3").CurrentRegion
Dim sSearch As String: sSearch = "*" & Target.Value & "*"
Dim cell As Range
Dim oList As Object: Set oList = CreateObject("System.Collections.ArrayList")
Dim v As Variant
For Each cell In rngX.Cells
v = cell.Value
If v Like sSearch Then
If Not oList.contains(v) Then
oList.Add v
End If
End If
Next cell
'Debug.Print sValidation
If oList.Count = 0 Then
MsgBox "No matches"
Exit Sub
End If
oList.Sort
'oList.Reverse
'Dim sValidation As String
sValidation = Join(oList.toarray, ",")
'Set Validation
With Target.Offset(0, 1).Validation
.Delete
.Add xlValidateList, Formula1:=sValidation
.Parent.Value = ""
End With
End Sub
|
|
[불량 게시물 신고] |
|
|
|
작성일 : 2019-04-17(21:45)
최종수정일 : 2019-04-17(21:45) |
|
|
|
|