Hi ppl, i have this code, that when for example the cell U50 in Sheet1 is above the number difined in Sheet2 cell P15 it pops up a window saying that is above limit, it works well in an workbook but now i want to do the same to another workbook but i dont remember how does the "Val2" receives the value from Sheet1 U50 to test it, and do some code needs to be inside a function like a Private Sub Worksheet_Change(ByVal Target As Range) ?
Can anyone help me to refresh my memory? Thanks 
Public Function MaximumExcededCPT2(Val2) As Boolean
Dim MaxCompt2Weight As Range
Set MaxCompt2Weight = Sheet2.Range("P15")
If Val2 > MaxCompt2Weight Then
MsgBox "Maximum Weight for compartment 2 is " & MaxCompt2Weight
MaximumExcededCPT2 = True
End If
End Function
Bookmarks