XLA routines: EE_Find
The problem with Excel's "Find" routine is that it does not reset the Find criteria, so that when you use CTRL+F on the worksheet, you have to reset all the params.
EE_Find gets around this by resetting the criteria.
Returns a range object or nothing
Function EE_Find(strFind As String, rngRangeToFindIn As range) As range '- takes a string, RangeToLookIn '- returns a range of the first cell containing the string '- uses .Find method, and looks for exact match, in whole cell '- returns the 'exact match' checkbox back to unchecked 'http://excelexperts.com/xla-routines-eeFind for updates on this function Set EE_Find = rngRangeToFindIn.Find(what:=strFind, LookIn:=xlValues, lookat:=xlWhole) Cells.Find what:="", _ after:=ActiveCell, _ LookIn:=xlFormulas, _ lookat:=xlPart, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=False, _ SearchFormat:=False Cells.Replace what:="", Replacement:="", ReplaceFormat:=False End Function
»
- Nick's blog
- Login or register to post comments
- 3188 reads
Recent comments
5 years 41 weeks ago
6 years 27 weeks ago
6 years 39 weeks ago
6 years 42 weeks ago
6 years 43 weeks ago
6 years 48 weeks ago
7 years 4 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago