Link to home
Start Free TrialLog in
Avatar of Murray Brown
Murray BrownFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Excel VBA Find row and column number of word

Hi

What Excel VBA code would use to find a partial match of a word "AC223" using the FIND function and return the row number and column number of the cell found?
Avatar of Louis LIETAER
Louis LIETAER
Flag of France image

Hi Murray, you could adapt following code to your needs

Sub Search_Range_For_Text()
Dim cell As Range
    For Each cell In ActiveSheet. usedrange
        If InStr(cell.Value, "AC223") > 0 Then
            debug print cell.address
        End If
    Next cell  
End Sub
cells.find("AC223",,,xlpart).row
cells.find("AC223",,,xlpart).column
ASKER CERTIFIED SOLUTION
Avatar of byundt
byundt
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Murray Brown

ASKER

thanks very much. That'll work well