View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel[_774_] joel[_774_] is offline
external usenet poster
 
Posts: 1
Default Find Value in Workbook


VBA Code:
--------------------



Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub


If Not Application.Intersect(Range("J3"), Target) Is Nothing Then

Dim FoundCell As Range
ShtName = target.parent.name

Found = False
for each sht in sheets
if Sht.name < ShtName then
Data = Sht.Range("J3").value

if Data = target.value then
set DestLocation = Sht.Range("J3")
found = True
end if
end if
next sht
end if
Set FoundCell = .Range("D:D").Find(what:=Range("J3").Value)


If Found = false Then
MsgBox "EIN not found. Do not include the dashes in your search."
Else
DestLocation.parent.activate
DestLocation.select
End If
End Sub




--------------------


--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=186241

Excel Live Chat