VBA - Remove formula based on date

DancingIsForbidden

New Member
Joined
Sep 10, 2014
Messages
8
Hi there - Former lurker. First time poster.

I'm looking for some help with a table I'm creating. This table gathers the amount of data we input into our spreadsheet but we wish to arrange it in order to display the amount of data we input on a daily basis.

e.g.
10/09/2014: 234
11/09/2014: 303

What we currently have is the value we began off with in the morning and the value we've ended up with at night.

We would like the night value to convert to a value so that we may calculate the new data gathered on the new day.

All based on the date of course. Is this possible?

Many thanks
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
I would put in a worksheet_calculate event and then check it against the computer clock. So, if the time is after, say, 11:59PM and the sheet is calculated, then store that cell as a value.
 
Upvote 0
Have a macro that checks the system date against a cell that holds the "last updated" date every time the workbook is opened. If one > the other, add a new line to your table and update the "last updated" cell.

..assuming I've understood you correctly
 
Upvote 0
Many thanks guys. I'm going to attach a picture with exactly what I'm doing to paint a better picture.

4iAdaVU.png
 
Upvote 0
That was my description to PGuru.

Code:
Private Sub Workbook_Open()
    For x = 2 To [COLOR=#333333]Cells(Rows.Count, "A").End(xlUp).Row[/COLOR]
        If Cells(x, 1) < Now Then
            Cells(x, 4).Value = Cells(x, 4)
        End If
    Next x
End Sub

I think this code should be all you need. Obviously test it before saving, but if you throw that into your worksheet code, that should work for you.
 
Upvote 0
That was my description to PGuru.

Code:
Private Sub Workbook_Open()
    For x = 2 To [COLOR=#333333]Cells(Rows.Count, "A").End(xlUp).Row[/COLOR]
        If Cells(x, 1) < Now Then
            Cells(x, 4).Value = Cells(x, 4)
        End If
    Next x
End Sub

I think this code should be all you need. Obviously test it before saving, but if you throw that into your worksheet code, that should work for you.


I'm not entirely sure if I understand this. Is it possible to implement this in Google Sheets?
 
Upvote 0

Forum statistics

Threads
1,213,567
Messages
6,114,342
Members
448,570
Latest member
rik81h

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