stop auto updating date next day

swapnilpradhan2688

New Member
Joined
Jun 7, 2020
Messages
18
Office Version
  1. 2013
Platform
  1. Windows
  2. Mobile
  3. Web
I want to stop auto-updating date the next day. I used today() function but it is not helping.

thank you
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
if i entered data todays date should be dislplayed.
roll noname date
1xyz28/06/2020
2abc28/06/2020

but when i enter data on 29/06/2020, date should not be dynamically update of 28/06/2020
roll no
name
date
1xyz28/06/2020
2abc28/06/2020
3def29/06/2020

it should be like this for next day without auto updating previous date
 
Upvote 0
I want to stop auto-updating date the next day. I used today() function but it is not helping.
You can't do that with a formula.

You could use vba with this Worksheet_Change event code. Test in a copy of your workbook.
I have assumed that the entries are in columns A:B with date to go into column C.
To implement ..
1. Right click the sheet name tab and choose "View Code".
2. Copy and Paste the code below into the main right hand pane that opens at step 1.
3. Close the Visual Basic window & test.
4. Your workbook will need to be saved as a macro-enabled workbook (*.xlsm).

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
  Dim Changed As Range, rw As Range
  Dim Date_Val As Variant
  
  Set Changed = Intersect(Target, Columns("A:B"), Rows("2:" & Rows.Count))
  If Not Changed Is Nothing Then
    Application.EnableEvents = False
      For Each rw In Changed.EntireRow.Resize(, 2).Rows
        If Len(rw.Cells(1).Value & rw.Cells(2).Value) > 0 Then
          Date_Val = Date
        Else
          Date_Val = ""
        End If
        Range("C" & rw.Row).Value = Date_Val
      Next rw
    Application.EnableEvents = True
  End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,559
Messages
6,120,194
Members
448,951
Latest member
jennlynn

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