Hi gurus and experts,
I have written the following code to find out the specific string "currency" in a workbook controlled by another user.
Option Compare Text
Sub findtext()
Dim cll as range, endrow as integer, cl_name, rw_name
endrow = ActiveSheet.Cells.Find(what:="*", searchorder:=xlByRows, searchdirection:=xlPrevious).Row
For each cll in range(A:AZ" & endrow)
If InStr(cll.Value, "currency") > 0 Then
cl_name = Split(cll.Address, "$")(1)
rw_name = Split(cll.Address, "$")(2)
End If
Next cll
End Sub
However, the string "currency" is sometimes written as "cy", "ccy", or "cncy" by another user. To accommodate all possible 4 cases, I tried to find the cell and its address by using the wildcard "*", however, it did not work. Only the string value with exact match worked.
The reason I used "For Each" loop is because the user, at times, adds columns on adhoc basis and I cannot specify code to a particular column. The structure of report generally remains same.
Is there any means to solve this issue? I appreciate for your suggestions.
Thank you
Bookmarks