@PermaNoob이 최상의 솔루션입니다. Excel에서는 "편집"모드에있을 때 VBA를 사용하여 셀 값을 확인할 수 없습니다. 그러나 A1
위에 텍스트 상자를 놓고 "동적"검색을 실행하는 데 사용할 수 있습니다.
Start VBA macro when editing a cell
는
Private Sub TextBox1_Change()
Dim searchArea As Range, searchRow As Range, searchCell As Range
Dim searchString As String
Dim lastRow As Integer
Application.ScreenUpdating = False
searchString = "*" & LCase(TextBox1.Value) & "*"
' unhide rows to have the full search field when editing
Rows.Hidden = False
lastRow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
Set searchArea = Me.Range("A5", "A" & lastRow) 'Me.Range("A5").End(xlDown))
searchArea.EntireRow.Hidden = True
For Each searchRow In searchArea.Rows
For Each searchCell In searchRow.Cells
If LCase(searchCell) Like searchString Then
searchRow.Hidden = False
Exit For
End If
Next searchCell
Next searchRow
Application.Goto Cells(1), True
Application.ScreenUpdating = True
End Sub
나는 이것이 가능하다고 생각하지 않습니다. 셀을 사용하면 입력 할 때까지 실제로 셀을 변경하지 않습니다. 그러나 텍스트 상자에서는 모든 키 입력이 변경됩니다. – PermaNoob
변경 이벤트를 통해 작업을 트리거 할 수 있습니다. 왼쪽 클릭, 오른쪽 클릭 및 기타 추측 할 수있는 이벤트가 있습니다. 내 목표에 약간 비관적 인 걸 인정해야 해. VBA를 사용하여 셀과 특정 critera를 비교하는 경우 Enter 키를 누른 후에 만 VBA를 수행 할 수 있다고 생각합니다. 하지만 그것에 대해 잘 모르겠습니다. – EngJon
그냥 생각했습니다. 셀을 텍스트 상자에 연결 한 다음 VBA를 사용하여 선택 변경 이벤트에서 텍스트 상자를 숨기거나 표시 할 수 있습니다. 당신은 세포에 바로 입력 할 수 있도록 세포 위에 텍스트 박스를 놓을 수 있습니다 .... – PermaNoob