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
- 3155 reads
Recent comments
5 years 36 weeks ago
6 years 22 weeks ago
6 years 34 weeks ago
6 years 37 weeks ago
6 years 38 weeks ago
6 years 43 weeks ago
6 years 52 weeks ago
7 years 2 days ago
7 years 3 days ago
7 years 3 days ago