View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz JLGWhiz is offline
external usenet poster
 
Posts: 3,986
Default Help Needed With Message Box

I am not so sure that this is what you want. It will
only return the first occurence of the match to column
C of the source document to Column F of the search
document with value or Col G. But it does do that.

Private Sub Worksheet_Change(ByVal Target As Range)
Set x = Application.Intersect(Target, Columns("D"))
If Not x Is Nothing Then
luRng = Worksheets("Data").Range("F1:G5000")
y = Application.WorksheetFunction.VLookup(Target.Offse t(0, -1).Value,
luRng, 2, False)
End If
MsgBox y
End Sub

"nospaminlich" wrote:

I don't know if this is possible and if it is how I go about it but here
goes....

I have some data on a worksheet called Data

I have some summary info on another sheet called Summary

I want to have a message box appear when a user selects any cell in col D of
Summary where the message is the result of a lookup of the same row in Col C
against the range F1:G5000 in Data.

Hopefully this is clear but rather than pure text in the Message Box I want
the message to always be the formulaic result of
Vlookup(RC[-1],Data!F1:G5000,2,False)

How do I code that in the MsgBox () and how do I make the box appear for any
cell in Col D

Thanks a lot