Steve41553
New Member
- Joined
- Apr 8, 2014
- Messages
- 27
I’m trying to search for a specific value in a list.This code looks for zeroes and it works
This code asks for a specific value and generates error 91:
I’ve tried removing the find number format line and entering a specific number into the code instead of the variable f_val#. Grateful for suggestions.
Code:
Selection.Find(What:="0.00 ", After:=ActiveCell, LookIn:=xlValues, _
LookAt:=xlWhole, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
Code:
f_val# = InputBox(prompt:="Enter value to search for.")
' Application.FindFormat.NumberFormat = "#,##0.00_);[Red](#,##0.00)"
' Cells.Find(What:=f_val#, After:=ActiveCell, LookIn:=xlValues, _
LookAt:=xlWhole, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=True).Activate
Last edited by a moderator: