Changing a cells value depending on the date.

August 18, 2009 at 07:37:16
Specs: Windows Vista
I was wondering if it was possible to change a cells value depending on the date set on your computer.

If not is there any other software that you know of that can do this aswell as the basic stuff excel can do such as formulas, text size, text colour, bold, italic, underline, borders and that sort of thing.


See More: Changing a cells value depending on the date.

Report •

August 18, 2009 at 08:09:08
There is...what specifically are you trying to do?

Report •

August 18, 2009 at 08:43:29
Well I am creating my own balance sheet and what not and have worked out what my monthly income is. I am trying to add this to some other income that i dont get regulary every month to work out how much money I have atthat time. But to work this out accurately I would like Excel to every month and my monthly income to my Total income. If you see what I mean. Thanx for respnding so quickly =D


Report •

August 18, 2009 at 10:38:45
Here's what you need to consider:

If you want to automatically add a value to a cell on a specific date, you have to open the spreadsheet on that date.

If you want to automatically add a value to a cell on or after a specific date, you can open the spreadsheet anytime you want, but you have to have a way to prevent the value from being added more than once. That means you have to have some sort of "flag" that tell's Excel that the value has already been added.

This example, when placed in the ThisWorkbook module of the VBA editor, will compare the current month against the value in A1 whenever the workbook is opened. If it's greater than that number, it'll add 400 to A2 and set the value in A1 to the current month.

You'll need to reset the flag in January, but that's only once a year.

Private Sub Workbook_Open()
'Compare today's month against value in A1
If Month(Now) > Sheets(1).Range("A1") Then
'If it's a new month, then add value to A2 and increment month flag
  Sheets(1).Range("A2") = Sheets(1).Range("A2") + 400
  Sheets(1).Range("A1") = Month(Now)
 End If
End Sub

Note: This example is just to show you that something like what you want can be done. If you need something different, you'll need to be very specific with your requirements.

Report •

Related Solutions

Ask Question