If value > Today [Plus one day] Then

sampson32

Active Member
Joined
Jul 16, 2003
Messages
312
Office Version
  1. 2021
Platform
  1. Windows
Providing all earlier criteria is met this part of code only responds if the date (value) is later than the current date:

“.Value > Today Then”

How would I amend this code to only respond if the date (value) is later than the current date plus one day? (One day past current date)

Thanks

Sam
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Did you try doing just that, adding 1?

.Value > (Today + 1) Then
 
Upvote 0
activecell.formular1c1="=today()+1"
gives you tomorrow's date

can you use this trick to get your code?
 
Upvote 0
I was going on the assumption that your original code worked, but it appears that it does not (TODAY is not a valid VBA function, as written like that).

This should work:
If YourField.Value > (Date + 1) Then
 
Upvote 0
A contraire mon ame,

“Today” is in my code as in “If Range("F" & i).Value < Today Then”

and it works just fine.

I have “Today” in several variations of that line and the entire code works perfectly. Entire code posted last week.

I just need to add another variation for another column of data. For insured dispersal of products after receipt. If the products that have been here over a day without shipment.


Thanks,

Vinnie
 
Upvote 0
Vinnie,

Is TODAY a variable you have defined? If so, then yes, it would work, although it is unnecessary to have to use a variable to return today's date when you can use DATE().

If TODAY is not a user defined variable, the command does not work on my computer and causes errors (says undefined variable). Maybe you are using a special Add-In or different version of Excel that has this as a new option?

Anyway, was your original question answered? Both me and venkat provided solutions, did they work for you?
 
Upvote 0
If fact you are correct in both cases! “Today = Date” I did use a variable and it is unnecessary. A lesson learned!

I’m still figuring the code up to the Date + 1, I not as fast as you. I’m pretty sure it will work.

Thanks to both of you for you reply.

Vinnie
 
Upvote 0

Forum statistics

Threads
1,214,635
Messages
6,120,660
Members
448,975
Latest member
sweeberry

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