Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 265
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
custom data validation on cells with data validation values AKrobbins Excel Worksheet Functions 2 June 21st 11 04:20 PM
Validation Data using Validation Table cell range..... Dermot Excel Discussion (Misc queries) 16 January 5th 10 09:35 PM
data validation invalid in dynamic validation list ilia Excel Discussion (Misc queries) 0 November 7th 06 12:54 PM
data validation invalid in dynamic validation list ilia Excel Worksheet Functions 0 November 7th 06 12:54 PM
Data validation with validation lists and combo boxs Keith Excel Discussion (Misc queries) 1 October 12th 06 11:08 AM


All times are GMT +1. The time now is 11:41 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"