TecNik
February 26, 2014, 12:59pm
#1
Hi everyone,
I’ve got a quick query regarding a ‘find’ in Excel.
Having had a look at the Excel Applescript Guide am I correct in thinking you can’t tell Excel to find an exact match?
For example, if I have the value ‘abc1234’ in a cell, and I script Excel to find ‘bc’, it will find it in ‘abc1234’.
Is there a way to tell Excel to be specific and not match part of the value in a cell?
Thanks in advance.
McUsrII
February 26, 2014, 1:28pm
#2
Hello.
Microsoft Excel Scripting Dictionary:
find‚v : Finds specific information in a range, and returns a range object that represents the first cell where that information is found. Returns nothing if no match is found. Doesn’t affect the selection or the active cell.
find range
what text : The data to search for.
[after range object/ŒA1-style range reference/Œnamed range/Œlist of category names] : The cell after which you want to search. Note that after must be a single cell in the range. If this argument isn’t specified, the search starts after the cell in the upper-left corner of the range.
[look in formulas/Œcomments/Œvalues] : Specifies where the find method should look.
[look at part/Œwhole] : Specifies the part that should be looked at.
[search order by columns/Œby rows] : Specifies if the search should be rows or columns.
[search direction search next/Œsearch previous] : Specifies the search direction either next or previous.
[match case boolean] : Set to true to make the search case sensitive.
[match byte boolean] : Used only in the East Asian version of Microsoft Excel. Set to true to have double-byte characters match only double-byte characters. False to have double-byte characters match their single-byte equivalents.
→ range : The range which the specified data was found.
I’d see if the look at part/whole clause fits the bill.
TecNik
February 26, 2014, 1:52pm
#3
Hi McUsrII,
Thanks for the help, that’s just what I was looking for.
I’ll try reading a little slower next time!
McUsrII
February 26, 2014, 2:04pm
#4
Hello.
It beats me that another technique, could be to check the returned result, when there aren’t such options available as the Excel find command.
And you are not the only one that reads too fast at times. :lol: