Change Cell Alert
Put this in the Worksheet 3 Module. Here you are using the Sheet3 Change
Event which will fire each time any cell is changed in the worksheet. The
Target is the cell that was changed. The code tests if the Target is located
in Col. B and if it is then the message box will show. Hope this helps! If
so, let me know, click "YES" below.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 2 Then
MsgBox Target.Offset(0, -1).Value & " changed to " & Target.Value,
vbInformation
End If
End Sub
--
Cheers,
Ryan
"Dave" wrote:
I am very new to VBA and need some help regarding some codes. Here is the
complete scenario:
I have 3 worksheets:
Worksheet 1 = Master Page
Worksheet 2 = Data 1
Worksheet 3 = Data 2
In worksheet 3 I have got 2 columns. The first column has the name of the
companies and the second column has buy and sell signal which is based on
certain criteria and this cell updates
itself automatically in real time.
I would like to have a VBA Code which just flashes me a messagebox when ever
there is some change in Column 2 of Worksheet 3. The message should display
the updated value od column 2 (in
this case "buy" or "Sell" from Column 2 and also the name of the company
from the adjacent Column 1)
The message box should appear as follows:
"Microsoft changed to BUY"
Here Microsft is actually the value in Column 1 and the BUY is in Colummn 2.
The message box should appear even if I am on worksheet 1 and not on
worksheet 3.
|