ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Something akin to a C++ += or ++ for outside cell (https://www.excelbanter.com/excel-worksheet-functions/39782-something-akin-c-%3D-outside-cell.html)

MikeDH

Something akin to a C++ += or ++ for outside cell
 
I'm trying to update an outside cell every time a certain condition is met;
is there anything like a C++ += or ++ command - i.e. everytime 1000 value
500, F8=F8+1?

Harlan Grove

MikeDH wrote...
I'm trying to update an outside cell every time a certain condition is met;
is there anything like a C++ += or ++ command - i.e. everytime 1000 value
500, F8=F8+1?


No. One cell can't change the value in another cell EXCEPT when the 2nd
cell contains a formula referring to the 1st cell. You need to use a
Calculate event handler to check that Value has changed, and if so
increment cell F8 using a VBA statement like

Range("F8").Value = Range("F8").Value + 1



All times are GMT +1. The time now is 01:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com