Automatically fill cell with a set value on specific calendar day and time - excel

I want to automatically fill in a cell with a pre-set value on a specific calendar day and time.
Example:
On the 2023-03-01 at 08:00 I want the name 'John Doe' to be filled in cell A1 in excel file. How to go about this. Is it macro that is needed or are there other ways as well?
Edit: the Notebook will be closed down and its opened in a browser (if that even matters..). However, it will be opened on the date Im thinking of auto-filling text in a cell or two. One cell being a must, two cells being a bonus addition to my question.

You can use a formula:
=IF(NOW()>DATE(2023,3,1)+TIME(8,0,0),"John Doe","")

Related

Date in Spreadsheet shows as number when cell format is short date

One spreadsheet in the workbook has a column of dates that appear as left justified numbers, even though the format on the column is Short Date. Cannot set the column to number format, change alignment or force any other format. When a cell is selected it shows as a date in the cell and in the formula bar, but when focus is changed, it reverts to number. How to fix this?
The spread sheet was copied from another workbook, and was apparently protected in that workbook. Thus not able to format or change anything. Ended up selecting all cells in the worksheet and pasting into a new worksheet. Able to apply changes then.

Accessing ActiveX textbox value from cell formula

I cannot post my code because it is company property, but the issue is that I would like to enter a cell formula so that it automatically updates when particular other cells change.
I have two columns, one for prices in USD and another for another currency. The other currency column is a simple "=SUM..." but the currency conversion to USD is always changing, and the prices are large enough that these changes matter. As such, I have the user enter the conversion value in the activex textbox, and I want to set the formula of the USD cells to be the price in USD, so obviously I need to get this conversion value, but I cannot just type in the textbox name, that does not work.
I am using VBA, but I would like to enter this directly into the cell as "=FORMULA", where formula contains the activeX textbox value, so that it automatically updates.
As far as I have found in VBA, if I want to assign a formula to a cell, I have to do so within a sub or function, so I have to call the sub every time I want to update the cells, but I want this to be as automatic as Excel is for other cell formulas.
I have been playing with Worksheet_Change and considered worksheet_open but have had other issues. For example, there are many different cells that could change that I have to monitor for change, and I cannot simply monitor the price column in the other currency for change because when cells update from a formula, Worksheet change does not show those cells as having changed.
Maybe this is as simple as setting the cell formulas on worksheet_open, but I also have not had luck with getting cell.formula to even work. I could discard the textbox for a regular cell which would totally solve this problem, but I also have a textbox_lostfocus sub that I need to run, and I don't know how to do that for a cell.
Sorry for the long post, in summary, how can I assess a textbox value for use in a cell formula ideally without using vba?
This is what linked cells are for. You link your ActiveX textbox to a cell. The cell value then gets updated once you update the value of your textbox. You can reference this cell in your normal excel formulas. See here for a tutorial: https://analysistabs.com/vba-code/activex-controls/textbox/

Highlighting cells in a column based on other cells dates in the same row

I have a spreadsheet that is used to track the last date a set of logs was downloaded.
We need to take logs at around the 7 day mark if possible (not critical)..
We have approximately 170 assets that we do this to.
The way the spreadsheet is set up the new date is added to an ever expanding list (rather than just overwriting) i have used conditional formatting to show that a date is less than 7 days old but that cell can be 20 columns accross and is still hard to cross reference to the asset number. I want to highlight column A if any other cell in the same row is highlighted (unless you have a less clunky way of doing it, having the date highlighted really is unimportant it is simply as far as i can get on my own.
I even tried doing a sort by cell colour but that seems to require that i pick one coulmn only.
Thanks for your help.
Conditional formatting will do this for you. I used this example:Column A has dates, Columns B and C have miscellaneous gibberish. (click the link to view the image)
Select the entire range of cells you want to follow these rules (possibly just "select all" to be sure you are getting future additions as well, then choose Conditional Formatting from the ribbon.
Conditional Formatting > Use a formula to determine...
Then enter the following code. =TODAY()-$A2<7 Update $A2 with whatever cell contains your first date value, and be sure to put a $ in front of its column reference so that the formula references only your date column and doesn't wander.Code: =TODAY()-$A2<7
Click the "Format" button to set whatever format you like (I chose yellow fill).

Excel highlight the cell of the matched date

I just want to know if it is possible for a a certain cell to be highlighted based on date whenever I put notes into another cell? As you can see at the image below, there are set of calendar with dates.
Now what I want to achieve is to highlight those dates whenever I put notes into another cell as the image shown below
Let's say I input a note in 5-Jan, Saturday the cell in image 1 ( January 5 ) will be highlighted with background color
Your problem consists of two parts. First you need to know how to use conditional formatting based on a formula, then you need to map your calendar cells to the corresponding notes cells.
Conditional formatting based on a formula is documented on several places on the web, for example here. For your case, I have created a screenshot of a simple example:
The difficult part (or hard labour, depending on which route you choose) in your case is to map all cells in your calendar to the corresponding cells potentially containing the note. So you need a way to calculate which day in the year a particular cell is.
I think you could achieve that via 12 different conditional formatting formulas, where you refer to the contents of "this" cell using INDIRECT("RC",FALSE) to get the day of the month, and then add the number of days before that month (for which you need 11 different constants). That result can be used as the index into your array of potential notes. So for February, the formula to calculate the day of the year becomes:
31+INDIRECT("RC",FALSE)
Using that number to check the row in your notes column (let's say they are in column A), the conditional formula for all cells in February becomes
=NOT(ISBLANK(INDIRECT("A"&(31+INDIRECT("RC",FALSE)))))
Then do the same thing for each month, where the constant (like 31) is different for each of them.
Note that using "RC" in INDIRECT() like this only makes sense in a conditional formatting formula.

Excel - Conditional Formatting - Updates Based on Current Date

How would I go about applying conditional formatting to a range of cells (Excel 2007) based on the current date?
I have a six-week plan (each column represents a day in the week (Monday to Friday, excluduing weekends)) and I would like to shade each column in green as the day passes without any user interaction, so that when I look at it, it will accurately have 'marked off' each day.
This is what I hope to achieve: I view the plan on Monday 1st January. I then don't access it until Thursday 4th January; once the plan is opened, I will see that the columns M-W have been shaded in green, whereas the rest of the plan for the remainder of the six weeks remains unshaded and this should continue for the remainder of the duration of the six-week plan.
Is this possible?
I would imagine that VBA would be used to check the system time and then apply the formatting according to what day it is.
Many thanks.
UPDATE
This is how my planner looks:
Sure, it's possible. The following should put you on the right track.
First, you can record the last time the workbook was accessed by storing the current date/time in a cell at the time when the workbook closes. This can be done using the Workbook_BeforeClose event, which has to be put in the workbook module. Open the VBA editor (Alt-F11), then open the ThisWorkbook module and paste this code in it.
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Sheet1.Range("B2").Value = Now()
End Sub
Every time the workbook is closed, the date/time at closing time will be noted in cell B2 (change this as you see fit).
In cell B3, use the =NOW() Excel formula to show the current date time. Cells B2 and B3 now define the interval within which your columns should be highlighted.
Then how to format the columns... Say your columns have date headers as in the image above. Select your "calendar" range (C5:I12 in the example above) and click Conditional Formatting > New Rule... > Use a formula. The formula should be =AND(C$5>$B$2,C$5<$B$3) meaning that only the columns whose date in the header is after the workbook was closed last time, but before now (adjust as you see fit), will be formatted. Click Format... to select e.g. a green fill, or whatever. Then OK.
Of course you could refine this in many ways (e.g. rounding to the previous or next day at midnight) but at least you should be on the right track now.
Use this conditional formatting formula:
=IF(DAYS360(DATE(B$2;B$3;B$4);TODAY())>1;1;0)
what is does is
if(the difference between this colums date and today is more then 1 day, be true, otherwise false)
use it in a sheet like

Resources