VBA : Finding the cells value

Finding the cells value.



Dim Rng as Range

 '################ Searching in Partial 
With ActiveSheet
                .Cells(1, 1).Select
                .Rows("1:1").Select

                Selection.Find(What:="TextToFind", After:=ActiveCell, LookIn:=xlFormulas, _
                                LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
                                MatchCase:=True, SearchFormat:=False).Select
Set Rng = Selection
End With

'################ Searching in Whole values
With ActiveSheet
                .Cells(1, 1).Select
                .Rows("1:1").Select

                Selection.Find(What:="TextToFind", After:=ActiveCell, LookIn:=xlFormulas, _
                                LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
                                MatchCase:=True, SearchFormat:=False).Select
Set Rng = Selection
End With

Comments