Cách dùng Find để tìm 1 chữ

PHOTO EMBED

Tue Jun 20 2023 06:33:46 GMT+0000 (Coordinated Universal Time)

Saved by @minhhuyen172002 #vba

Sub FindExample()
    Dim searchRange As Range
    Dim foundCell As Range
    
    ' Set the range to search in (e.g., column A)
    Set searchRange = Range("A1:A10")
    
    ' Find the value "SearchValue" within the search range
    Set foundCell = searchRange.Find("SearchValue")
    
    ' Check if the value was found
    If Not foundCell Is Nothing Then
        ' Value was found
        MsgBox "Value found at cell " & foundCell.Address
    Else
        ' Value was not found
        MsgBox "Value not found"
    End If
End Sub
content_copyCOPY