Microsoft Excel - Found value in quotes not matching cell value without quotes, VBA Excel

Asked By Rowland Hamilton on 11-Feb-13 04:34 PM

Got correction from Mr. Excel:

[CODE]If FirstIO = Val(CheckIO) Then[\CODE]


Folks:

Attempting to match acct #s on source sheet with account numbers on Template but the numbers on the source are = to the cell value while the numbers on the template are equal to finding the source cell value in the template. Let me explain with code.

Set Source value:
Code:
Set FirstIO = zfir.Range("e8")
Set Template value:
Code:
Set CheckIO = Range("Accounts").Find(IO, LookIn:=xlValues)
When I get here:
Code:
If FirstIO = CheckIO Then
I get a mismatch because
FirstIO = 3333333 and CheckIO = "3333333"

How do I make these 2 values Match? 

  Thanks, Rowland
Pichart Y. replied to Rowland Hamilton on 11-Feb-13 08:37 PM
Hi Rowland,

Try this

Dim CheckIO As Double
Set Source value: 
Code:
Set FirstIO = zfir.Range("e8")
Set Template value:
Code:
CheckIO = val(Range("Accounts").Find(IO, LookIn:=xlValues))
Hope this help.

Pichart Y.