Hi all,
I have to say that I am quite new to excel.
I create a function that returns a cell that contains a value starting at certain cell. The problem is that sometimes it find the correct cell others (for the same value) it doesn't.
Here is my code:
Any Ideas about what could be wrong?
I have to say that I am quite new to excel.
I create a function that returns a cell that contains a value starting at certain cell. The problem is that sometimes it find the correct cell others (for the same value) it doesn't.
Here is my code:
Code:
Public Function FindXValueCell(selectedWorksheet As Worksheet, rowTextCell As Range, xValue As String) As Range
Dim cell As Range
Set cell = selectedWorksheet.Range(X_VALUES_COLUMN_CONST & ":" & X_VALUES_COLUMN_CONST) _
.Find(What:=xValue, After:=selectedWorksheet.Cells(rowTextCell.Row, X_VALUES_COLUMN_CONST), _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False)
Set FindXValueCell = cell
End Function
Any Ideas about what could be wrong?