VBA: Can't use the Find property of the Range class.

  • For some reason I can't use the following code in my application at work, when it's fine at home. (Older version of Excel and Windows at work)


    Range("A1:A100").Find(What:="Test").EntireRow.Select


    Anyone know why? The error I get is "Unable to use the Find property of the Range class".

  • I think that may be the problem since Find is trying to start after the activecell if nothing else is specified. If the activecell isn't in its scope, then it doesn't know what to do. Perhaps this is only true in Excel 97.

  • Ah, okay so in the above example if I stick an extra line of code in like:


    Range("A1").Activate


    Then the rest of it, it should work..? I'll give it a go, and I'll also try passing all of the parametres to the Find method to see if that helps, ie. LookAt, SearchOrder, etc.


    Thanks for your help, hope it works.


    Ted

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!