https://bugs.documentfoundation.org/show_bug.cgi?id=158185

Eike Rathke <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]
            Version|unspecified                 |Inherited From OOo

--- Comment #1 from Eike Rathke <[email protected]> ---
It looks like the Calc implementation assumed that # in VBA is not supposed to
find a literal # character, but is a wildcard matching a single digit instead.
See
https://learn.microsoft.com/en-us/office/vba/Language/Reference/User-Interface-Help/wildcard-characters-used-in-string-comparisons
. So returning $A$2 as the first match looks to be correct according to that.

But, with Find() Excel apparently (to be verified) does not do what that
documentation says.. and indeed
https://learn.microsoft.com/en-us/office/vba/api/excel.range.find says for What
only "Can be a string or any Microsoft Excel data type." and only later in
Remarks mentions "To find cells that match more complicated patterns, use a For
Each...Next statement with the Like operator."

It seems Calc implemented that Like operator behaviour with the Find() function
(translating those wildcard operators to regular expressions).

Code pointers:
sc/source/ui/vba/vbarange.cxx ScVbaRange::Find() and ScVbaRange::Replace() and
their calls to VBAToRegexp(sWhat) and see use of SC_UNO_SRCHREGEXP property.

That may be wrong, but caveat, changing it may as well break existing VBA code
created with OOo/LibreOffice that relies on it.. though maybe people didn't
dive that far into it.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to