Static date and time

jw4th

New Member
Joined
Jan 30, 2016
Messages
5
I have an excel workbook that takes data from the first sheet and puts it into additional sheets. I have set up formulas that take the data from one to the other. Because of the formulas, one column always has zeros in it until the data from the first page is inserted. I would like to have a static date and time entered in another cell once the data in the cell with the formula becomes greater than 0. Is this possible? Very inexperienced with excel. Thanks in advance!
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Lets say the cell with the formula is A1 and we want the date/time stored in B1. Place the following event macro in the worksheet code area:
Code:
Private Sub Worksheet_Calculate()
   If Range("A1").Value > 0 And Range("B1") = "" Then
      Application.EnableEvents = False
         Range("B1").Value = Now
      Application.EnableEvents = True
   End If
End Sub
 
Upvote 0
So that seems to work. You will have to pardon my ignorance, but if i want this to cover a range of cells versus just one cell, how would i modify the code to cover say a1-a50 and put resulting static date in b1-b50?
Thanks!
 
Upvote 0

Forum statistics

Threads
1,214,971
Messages
6,122,517
Members
449,088
Latest member
RandomExceller01

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