Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA for Data Validation
When a string is entered in file1.xls column range A:A, I would like to see if it is on file2.xls column range A:A and if it is, a message box come up with instructions...and to deny the entry of the string. Of course, if it is not in file2.xls, then the string will remain. file1.xls (A:A) file2.xls (A:A) BobA TimE JackC SaraE If I try to enter TimE into file1.xls, a message will pop up because TimE is listed in file2.xls ANY help would be appreciated. Thanks in advance. -- TimE ------------------------------------------------------------------------ TimE's Profile: http://www.excelforum.com/member.php...fo&userid=2139 View this thread: http://www.excelforum.com/showthread...hreadid=489144 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA for Data Validation
easy
on your sheet objects (file 1.xls): Private Sub Worksheet_Change(ByVal Target As Range) if left(target.address,2)=$A then a=target windows("file 2.xls").activate for b=1 to ActiveSheet.Range("A1", activesheet.Range("A65535").End(xlUp)).EntireRow.c ount if a=cells(a,1) then windows(file 1.xls).activate target="" msgbox "Whatever you want to say","button","title" end end if next windows(file 1.xls").activate end sub this should works, any problems just write me "TimE" wrote: When a string is entered in file1.xls column range A:A, I would like to see if it is on file2.xls column range A:A and if it is, a message box come up with instructions...and to deny the entry of the string. Of course, if it is not in file2.xls, then the string will remain. file1.xls (A:A) file2.xls (A:A) BobA TimE JackC SaraE If I try to enter TimE into file1.xls, a message will pop up because TimE is listed in file2.xls ANY help would be appreciated. Thanks in advance. -- TimE ------------------------------------------------------------------------ TimE's Profile: http://www.excelforum.com/member.php...fo&userid=2139 View this thread: http://www.excelforum.com/showthread...hreadid=489144 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
custom data validation on cells with data validation values | Excel Worksheet Functions | |||
Validation Data using Validation Table cell range..... | Excel Discussion (Misc queries) | |||
data validation invalid in dynamic validation list | Excel Discussion (Misc queries) | |||
data validation invalid in dynamic validation list | Excel Worksheet Functions | |||
Data validation with validation lists and combo boxs | Excel Discussion (Misc queries) |