close

Hi,

I have 3 sheets whereby sheet 1 is linked to sheets 2 amp; 3. If I type some
things in sheets 2 amp; 3, cell C36 in sheet 1 may or may not change. If it
changes to more than 0, I want a message box to prompt me.

I setup the vba code as below BUT it only works if the changes are done in
sheet 1, ie, if i change some things in sheets 2 amp; 3 and C35 in sheet 1
changes, there is no prompt but if I change some things in sheet 1 such that
C36 changes, THEN i get the prompt. How can I change the code to do what I
want in paragraph 1 above?

Thanks!

Private Sub Worksheet_Change(ByVal Target As Range)Dim Change As Variant

Change = Range(quot;C36quot;).Value
If Change gt; 0 Then
MsgBox quot;Errorquot;
End IfEnd Sub

Maybe using worksheet_calculate would be better than _change.
Dolphinv4 wrote:
gt;
gt; Hi,
gt;
gt; I have 3 sheets whereby sheet 1 is linked to sheets 2 amp; 3. If I type some
gt; things in sheets 2 amp; 3, cell C36 in sheet 1 may or may not change. If it
gt; changes to more than 0, I want a message box to prompt me.
gt;
gt; I setup the vba code as below BUT it only works if the changes are done in
gt; sheet 1, ie, if i change some things in sheets 2 amp; 3 and C35 in sheet 1
gt; changes, there is no prompt but if I change some things in sheet 1 such that
gt; C36 changes, THEN i get the prompt. How can I change the code to do what I
gt; want in paragraph 1 above?
gt;
gt; Thanks!
gt;
gt; Private Sub Worksheet_Change(ByVal Target As Range)
gt;
gt; Dim Change As Variant
gt;
gt; Change = Range(quot;C36quot;).Value
gt; If Change gt; 0 Then
gt; MsgBox quot;Errorquot;
gt; End If
gt;
gt;
gt; End Sub

--

Dave Peterson

全站熱搜
創作者介紹
創作者 software 的頭像
software

software

software 發表在 痞客邦 留言(0) 人氣()