Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to track a change in a cell content
Dear All,
I have a problem with an excel application. I am using an excel add-in written by someone else, I do not have access to the code (it is in a dll). The add-in connects to some machines that we have here in the labs. The machines are in a network. In the cells of an excel workbook, I can monitor the temperature of the machines in the labs during the experiments and get warning signals if anything goes wrong. My problem is that I would like to track the temperature of the machines in a database. Actually, I would like to record temperature changes in the database. An example of what I mean will make things clear. Let's say that I have the following time series (time in seconds and temperature in Celsius): time temperature 00001 200 00002 200 00003 202 00004 200 00005 200 00006 203 00007 203 00008 200 00009 200 00010 200 What I want to store in the database is the following: time temperature 00001 200 00003 202 00004 200 00006 203 00008 200 which is what gets displayed in the Excel cell. I know how to copy a value from a cell to another (or to an Access database), what I do not know is to code in VBA the following: "when the content of this cell changes, then copy it to the other location". I tried the following: Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$A$1" Then MsgBox ("A1 has changed") End If End Sub but in my case is not appropriate because it works if the cell content is changed by the user only. Has any of you got an idea of how to do it? I thank you in advance for your time. S |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to track a change in a cell content
S,
Put a formula in another cell that links to the cell being changed. When that cell updates, it should force a calculate event, which you can then use. HTH, Bernie MS Excel MVP "S" wrote in message m... Dear All, I have a problem with an excel application. I am using an excel add-in written by someone else, I do not have access to the code (it is in a dll). The add-in connects to some machines that we have here in the labs. The machines are in a network. In the cells of an excel workbook, I can monitor the temperature of the machines in the labs during the experiments and get warning signals if anything goes wrong. My problem is that I would like to track the temperature of the machines in a database. Actually, I would like to record temperature changes in the database. An example of what I mean will make things clear. Let's say that I have the following time series (time in seconds and temperature in Celsius): time temperature 00001 200 00002 200 00003 202 00004 200 00005 200 00006 203 00007 203 00008 200 00009 200 00010 200 What I want to store in the database is the following: time temperature 00001 200 00003 202 00004 200 00006 203 00008 200 which is what gets displayed in the Excel cell. I know how to copy a value from a cell to another (or to an Access database), what I do not know is to code in VBA the following: "when the content of this cell changes, then copy it to the other location". I tried the following: Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$A$1" Then MsgBox ("A1 has changed") End If End Sub but in my case is not appropriate because it works if the cell content is changed by the user only. Has any of you got an idea of how to do it? I thank you in advance for your time. S |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Change Cell Content | Excel Discussion (Misc queries) | |||
Change format of cell content | Excel Discussion (Misc queries) | |||
change content of a given cell as different cells are indicated | Excel Worksheet Functions | |||
how do I change the content of one cell based on another? | Excel Discussion (Misc queries) | |||
Change picture according to cell content | Excel Programming |