VBA code or formula: Stop counting (updating) IF value is X

Dedeke

Board Regular
Joined
Dec 1, 2020
Messages
70
Office Version
  1. 2016
Platform
  1. Windows
Hi there super users,

I know strange title want excel to stop counting. Gone try to explain as easy as possible. I'm keeping up the droven km of a motorcycleclub.
So i have colum A: is a fixed value (nr) Colum B: is a changing value (nr) Colum C: is the total A+B
Having more colums with IF formules in it. So Colum D: gives "25" if Colum C is 25; colum E: gives 50 when Colum C is 50 and so on.

Is it possible to have the date (extra colum or same colum does not matter) when the value 25 is reached. The same for 50 and so on.
While the value in colum C is growing (logic) i don't want the dates changing again.

Ex: C= 25 D= date 02/12/20 C= becomes 30 on date 10/12/20 D= should stay the same date as it was (02/12/20)

Already many thanks
 
CeCeR

I appriciate all the efforts till now.
I mean time I found this solution.

VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

For Each c In Range("Q1:Q79").Cells
      If c.Value = "X" And c.Offset(, 1).Value = "" Then c.Offset(, 1).Value = Date
   Next
For Each c In Range("X1:X79").Cells
      If c.Value = "X" And c.Offset(, 1).Value = "" Then c.Offset(, 1).Value = Date
   Next
End sub

Anyway i will save your last proposal, i will try it out another time.
Youl never now if it's a better one.

Thx for diggin in to this. Can be marked as solved.
 
Last edited by a moderator:
Upvote 0
Solution

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

Forum statistics

Threads
1,214,940
Messages
6,122,352
Members
449,080
Latest member
Armadillos

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top