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 |
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 |
All times are GMT +1. The time now is 01:08 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com