Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The "Find" method has a match case option.
-- Jim Cone Portland, Oregon USA "PBezucha" wrote in message Dear Chip, Your statement is absolutely correct. Still it is an example of overdoing in VBA. If I should find the row of exact equality, the eqality itself does the job, no binary comparison is needed. If I can ask again, has somebody a smarter solution to the problem of finding the row of the first, case identical cell content than my recurrent code: Option Explicit Function MatchRow(DBName As String, Sought As Variant) As Long Dim DB As Range, FirstRow As Long, LastRow As Long With Worksheets(DBName) FirstRow = 1 LastRow = .Cells(FirstRow, 1).End(xlDown).Row MatchRow = FirstRow On Error GoTo ErrExit Do Set DB = Range(.Cells(MatchRow, 1), .Cells(LastRow, 1)) MatchRow = Application.Match(Sought, DB, 0) + MatchRow - FirstRow If .Cells(MatchRow, 1).Value = Sought Then Exit Function 'IDENTITY TEST! MatchRow = MatchRow + 1 Loop End With ErrExit: End Function Of course browsing with the same identity test runs OK too, but (how much?) more slowly. Thanks for your interest -- Petr Bezucha |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
countif function: how to distinguish case/make case sensitive | Excel Worksheet Functions | |||
Getting a case sensitive match? | Excel Worksheet Functions | |||
Case Sensitive w/ IF | Excel Worksheet Functions | |||
.Name case sensitive | Excel Programming | |||
can vlookup be forced to make a case sensitive match? | Excel Discussion (Misc queries) |