Save file x minutes after a value is entered

raceymacey

New Member
Joined
Oct 4, 2018
Messages
2
Hi,

I have created a spreadsheet for uses to record production testing results ad this forum has been essential in automating some of the task. But now if find that users are not saving the results.

I know I can use the OnTime application to autosave the file but I only want this to kick in after a specific cell (say F11) has been populated.

what would be the code for this?

many thanks
 

Yongle

Well-known Member
Joined
Mar 11, 2015
Messages
4,607
Office Version
365
Platform
Windows
Place in sheet module (right-click sheet tab \ View Code \ paste code in code window \ {alt}{F11} to go back to Excel)

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Range("F11"), Target) Is Nothing Then ThisWorkbook.Save
End Sub
 

Yongle

Well-known Member
Joined
Mar 11, 2015
Messages
4,607
Office Version
365
Platform
Windows
Why complicate the code? :confused:
VBA will simply save again with corrected value

You could modify the code I gave you earlier and insert a delay before saving ....
Code:
If Not .... then
    [COLOR=#ff0000]DELAY goes here[/COLOR]
   ThisWorkbook.Save
End if
 

Forum statistics

Threads
1,081,421
Messages
5,358,584
Members
400,505
Latest member
JacquiT

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top