close

When a value is entered into, say, cell B5, I want that value to be
added to, say, E5. I could do this by attaching a macro to a shortcut
key, or preferably when the cell loses focus.

Any ideas ?

Thanks
Robert--
RobertLees
------------------------------------------------------------------------
RobertLees's Profile: www.excelforum.com/member.php...oamp;userid=26580
View this thread: www.excelforum.com/showthread...hreadid=533208Robert,

Put the following code in the code module for the appropriate
worksheet.

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = quot;$B$5quot; Then
Application.EnableEvents = False
Range(quot;E5quot;).Value = Range(quot;E5quot;).Value Target.Value
Application.EnableEvents = True
End If

End Sub--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.comquot;RobertLeesquot;
gt; wrote
in message
...
gt;
gt; When a value is entered into, say, cell B5, I want that value
gt; to be
gt; added to, say, E5. I could do this by attaching a macro to a
gt; shortcut
gt; key, or preferably when the cell loses focus.
gt;
gt; Any ideas ?
gt;
gt; Thanks
gt; Robert
gt;
gt;
gt; --
gt; RobertLees
gt; ------------------------------------------------------------------------
gt; RobertLees's Profile:
gt; www.excelforum.com/member.php...oamp;userid=26580
gt; View this thread:
gt; www.excelforum.com/showthread...hreadid=533208
gt;
if you wanted a range in a column to be added to E5, like b5, then b6,
then b7, etc, how would you change the procedure?

John

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

software

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