ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Insert date automatically (https://www.excelbanter.com/excel-discussion-misc-queries/20067-insert-date-automatically.html)

Rick

Insert date automatically
 
I have a column with values such as:
3/25

3/24

3/29
3/21
3/21
3/21

And wish to automatically add todays date if the value of the cell is blank
in the mm/dd format. I have used an =If(Column:Column="",TODAY()) in a
column next to it and formatted it in mm/dd to get the desired result. But
how can I take this value (todays date) and insert it back into the original
column automatically and without changing the other valuse?

As always thank you!

Rick

Dave O

Hi, Rick: Here's one way.

Step 1 is to make a backup of your original file so you have a fallback
in case something goes horribly wrong. Assuming your date column is
currently A, insert a new column to the right of that: call it column
B. Enter a formula in column B for each relevant cell in column A:
=IF(A1="",TODAY(),A1)
.... then copy this formula for the remaining cells.

This will use today's date for blank cells, but will show the existing
date if the cell is not blank.

Copy the new column and paste it as values into column A. The original
values will be right where they started, and the blanks will now be
filled with today's date.


Rick

Thanks for the assistance. I followed your suggestion, but created a macro
to automate the copy and paste of the final product. Worked very well.
Thanks again.

"Dave O" wrote:

Hi, Rick: Here's one way.

Step 1 is to make a backup of your original file so you have a fallback
in case something goes horribly wrong. Assuming your date column is
currently A, insert a new column to the right of that: call it column
B. Enter a formula in column B for each relevant cell in column A:
=IF(A1="",TODAY(),A1)
.... then copy this formula for the remaining cells.

This will use today's date for blank cells, but will show the existing
date if the cell is not blank.

Copy the new column and paste it as values into column A. The original
values will be right where they started, and the blanks will now be
filled with today's date.




All times are GMT +1. The time now is 02:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com