ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Add future date to cell (https://www.excelbanter.com/excel-programming/369024-add-future-date-cell.html)

chris46521[_13_]

Add future date to cell
 

I want to have a future date (30 days from today’s date) added to a cell
in column A only if that cell is already blank and column N has an “O”
in that same row. Here is the code that I have right now, and it works
to add a value based on the conditions that I just described. I just
don’t know how to get it to add a date to that is 30 days in advance of
today’s date. Thanks for any help!


Code:
--------------------
If Me.Cells(.Row, "N").Value = "O" And Me.Cells(.Row, "A").Value = "" Then
Me.Cells(.Row, "A").Value = "1"
End If
--------------------


--
chris46521
------------------------------------------------------------------------
chris46521's Profile: http://www.excelforum.com/member.php...o&userid=35909
View this thread: http://www.excelforum.com/showthread...hreadid=567160


AP[_2_]

Add future date to cell
 
Try Now() + 30



AP
www.megacrosstab.com

chris46521 wrote:
I want to have a future date (30 days from today's date) added to a cell
in column A only if that cell is already blank and column N has an "O"
in that same row. Here is the code that I have right now, and it works
to add a value based on the conditions that I just described. I just
don't know how to get it to add a date to that is 30 days in advance of
today's date. Thanks for any help!


Code:
--------------------
If Me.Cells(.Row, "N").Value = "O" And Me.Cells(.Row, "A").Value = "" Then
Me.Cells(.Row, "A").Value = "1"
End If
--------------------


--
chris46521
------------------------------------------------------------------------
chris46521's Profile: http://www.excelforum.com/member.php...o&userid=35909
View this thread: http://www.excelforum.com/showthread...hreadid=567160



AP[_2_]

Add future date to cell
 
or TODAY() + 30 if you dont need the time included

AP
www.megacrosstab.com
chris46521 wrote:
I want to have a future date (30 days from today's date) added to a cell
in column A only if that cell is already blank and column N has an "O"
in that same row. Here is the code that I have right now, and it works
to add a value based on the conditions that I just described. I just
don't know how to get it to add a date to that is 30 days in advance of
today's date. Thanks for any help!


Code:
--------------------
If Me.Cells(.Row, "N").Value = "O" And Me.Cells(.Row, "A").Value = "" Then
Me.Cells(.Row, "A").Value = "1"
End If
--------------------


--
chris46521
------------------------------------------------------------------------
chris46521's Profile: http://www.excelforum.com/member.php...o&userid=35909
View this thread: http://www.excelforum.com/showthread...hreadid=567160



Bob Phillips

Add future date to cell
 
If Me.Cells(.Row, "N").Value = "O" And Me.Cells(.Row, "A").Value = ""
Then
Me.Cells(.Row, "A").Value = Date + 30
End If


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"chris46521" wrote
in message ...

I want to have a future date (30 days from today’s date) added to a cell
in column A only if that cell is already blank and column N has an “O”
in that same row. Here is the code that I have right now, and it works
to add a value based on the conditions that I just described. I just
don’t know how to get it to add a date to that is 30 days in advance of
today’s date. Thanks for any help!


Code:
--------------------
If Me.Cells(.Row, "N").Value = "O" And Me.Cells(.Row, "A").Value = ""

Then
Me.Cells(.Row, "A").Value = "1"
End If
--------------------


--
chris46521
------------------------------------------------------------------------
chris46521's Profile:

http://www.excelforum.com/member.php...o&userid=35909
View this thread: http://www.excelforum.com/showthread...hreadid=567160




chris46521[_14_]

Add future date to cell
 

That worked great guys! Thanks so much for your help!


--
chris46521
------------------------------------------------------------------------
chris46521's Profile: http://www.excelforum.com/member.php...o&userid=35909
View this thread: http://www.excelforum.com/showthread...hreadid=567160



All times are GMT +1. The time now is 06:19 PM.

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