ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VB programing (https://www.excelbanter.com/excel-programming/313022-vbulletin-programing.html)

Mestrella31

VB programing
 
I need a cross check that will verify if several cells on a WB equal (or is +
/ - 2 units)

also that verify in another workbook also.

can some one help me.

sebastienm

VB programing
 
sorry i don't understand what you want.
Could you please be more specific and give an example.
Thanks,
Sebastien

"Mestrella31" wrote:

I need a cross check that will verify if several cells on a WB equal (or is +
/ - 2 units)

also that verify in another workbook also.

can some one help me.


kkknie[_219_]

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


Mestrella31

VB programing
 
Thanks KKKnie, this is going to work

"kkknie" wrote:


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.

K


--
kkknie
------------------------------------------------------------------------
kkknie's Profile: http://www.excelforum.com/member.php...fo&userid=7543
View this thread: http://www.excelforum.com/showthread...hreadid=267810




All times are GMT +1. The time now is 01:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com