![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: May 2002
Posts: 25
|
Hi,
I have a machine that packs product. The machine counts the amount of product packed. im using a DDE (Dynamic Data Exchange) link to get the counted value to Excel. The count is linked to cell A1. lets say for instance the count is 1289 then the operator on the machine resets the count to 0. How can i log the highest count from cell a1 each time it is reset to 0 to say cell B1??? [ This Message was edited by: mcleve on 2002-05-19 19:25 ] |
|
|
|
|
|
#2 |
|
New Member
Join Date: May 2002
Posts: 25
|
I know I havent stumped this board with this....Anyone??
|
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Apr 2002
Location: Greenwood, SC
Posts: 677
|
Not sure whether DDE triggers the Change method of the worksheet, but if it does, this may work. I tried it out making manual changes and it is fine...
In the code for the WORKSHEET, place this: Public lstValue Private Sub Worksheet_Change(ByVal Target As Range) If Target.Row = 1 And Target.Column = 1 Then If Target.Value = 0 Then Range("B1").Value = lstValue lstValue = Target.Value End If End Sub K |
|
|
|
|
|
#4 |
|
New Member
Join Date: May 2002
Posts: 25
|
Thanks A Bunch!!!
That was perfect!!!!! |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|