ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   information message (https://www.excelbanter.com/excel-programming/402795-information-message.html)

K[_2_]

information message
 
Hi, what macro do i need to creat message that this value is not in
the list. like if i put some value in any cell of coloumn A in sheet 1
and it looks up that value into coloumn B of sheet 2 and if the value
is not there the message should pop up that this value is not in the
list. the macro should just bring the message and do nothing else and
you can still put new value in coloumn A.
Plese is there anybody can help. Thanks........

Ron de Bruin

information message
 
Hi K

You can use this event in the sheet module of Sheet1

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then
If Application.WorksheetFunction.CountIf(Sheets("Shee t2").Columns("B"), Target.Value) = 0 Then
MsgBox "not exist in Sheet2"
End If
End If
End Sub




--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"K" wrote in message ...
Hi, what macro do i need to creat message that this value is not in
the list. like if i put some value in any cell of coloumn A in sheet 1
and it looks up that value into coloumn B of sheet 2 and if the value
is not there the message should pop up that this value is not in the
list. the macro should just bring the message and do nothing else and
you can still put new value in coloumn A.
Plese is there anybody can help. Thanks........



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

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