Thread: VB programing
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
kkknie[_219_] kkknie[_219_] is offline
external usenet poster
 
Posts: 1
Default VB programing


Dim dblCheck as Double

dblCheck = Abs(Range("A1").Value - Range("B1").Value)
If dblCheck 2 Then
'Whatever you want to do if they are out of tolerance
End If

Or if they are on different (open) workbooks

dblCheck
Abs(Workbooks("Book1.xls").Sheets("Sheet1").Range( "A1").Value
Workbooks("Book2.xls").Sheets("Sheet1").Range("B1" ).Value)
If dblCheck 2 Then
'Whatever you want to do if they are out of tolerance
End If

Adapt to fit your circumstances.



--
kkkni
-----------------------------------------------------------------------
kkknie's Profile: http://www.excelforum.com/member.php...nfo&userid=754
View this thread: http://www.excelforum.com/showthread.php?threadid=26781