Share via

Excel VBA Find

Anonymous
2020-09-13T20:20:23+00:00

Hi All,

I wonder what does LookIn:=xlFormulas2 do in the Find command?

Macro recording produced this code snippet and it works on my computer where the macro was recorded but doesn't work on other computers. What's more, a simple LookIn:=xlFormulas works, too. Why is xlFormulas2 necessary?

Thanks,

Stefi

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

5 answers

Sort by: Most helpful
  1. Anonymous
    2020-09-13T21:09:40+00:00

    Take a look at the discussion of the Range.Formula2 property

    It is functional in versions of Excel that support dynamic arrays, otherwise not.

    That's why it works in yours, but not in all.

    Was this answer helpful?

    4 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2020-09-14T22:19:27+00:00

    I've never tried it, but I suppose you could test to see if the Range.Formula2 property returns a 438 error.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  3. Anonymous
    2020-09-14T16:13:22+00:00

    Thanks, Ron! How can I detect by VBA means if the current Excel version supports dynamic arrays or not?

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  4. HansV 462.6K Reputation points
    2020-09-13T20:25:39+00:00

    That's the problem with Microsoft: they added a constant xlFormulas2 but as far as I can tell it isn't documented... :(

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  5. Anonymous
    2020-09-13T20:52:28+00:00

    Thank you for your answer! Although the issue still exists, it's good to know that I am not alone with the problem and it is not due to my lack of knowledge.

    Was this answer helpful?

    0 comments No comments