I have 2 sheets, one the user inputs data used as search criteria and the second sheet is the data being searched. Both my search value cell and column are formatted as a number with 4 decimal places: 0.0000
the user enters value into C6 want to filter search sheet, column 19 or S
Worksheets("Data").Range("$A$1:$AX$20000").autofilter Field:=19, criteria1:=Worksheets("Lookup").Range("C6")
Example: C6 on lookup sheet = 0.0650 but it sets the autofilter to 0.065 which returns nothing, which for some reason does not = 0.650 which returns appropriate results.
I'm very confused here and not sure how to look this up. Thanks in advance :)
Edit: This happens for a data lookup as well (for loop).
for i = 1 to LastRow
If Not IsError(Worksheets("Data").Cells(i, 1).Value) Then
If strItem = Worksheets("Data").Cells(i, 1).Value Then
intRow = Trim(fncRemoveAlpha(Replace(Worksheets("Data").Cells(i, 1).Address, "$", "")))
Me.Cells(12, 6).Value = Worksheets("Data").Cells(intRow, 14)
end if
end if
next i
I understand it is a text comparison and not a number comparison, but I'm not sure why it isn't a number comparison to begin with. Formatting the cell and/or the data does not seem to resolve this.