I have a Basic macro that searches a spreadsheet cell range for a string:
cu = sheet.createCursorByRange(sheet.getCellRangeByName("A1"))' Cursor object comprising the
cu.gotoEndOfUsedArea(True) ' Entire used area of the sheet
so = cu.createSearchDescriptor() ' Create the SearchObject
so.SearchString = "SomeString" ' Specify the string to find
so.SearchType=1 ' Search Values
sr = cu.findAll(so) ' Execute the search
It works just fine.
After some trial and error, I discovered that setting SearchType=0
searches Formulas rather than Values. I’d much prefer to write so.SearchType=VALUES
and so.SearchType=FORMULAS
, but try as I might, I cannot find any documentation that lists the valid Enumeration Names for SearchType. Can anyone provide a reference?