Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

set a myDate = 100 days from today

Status
Not open for further replies.

cboz

Technical User
Dec 24, 2002
42
US
I want to use a date that is 100 days from today in a maco. I tried something like:

Dim myDte As Date
Set myDte = "=(Today() + 100)"

but that of course that doesn't work. I want to use this date to find dates that are greater than 100 days from today and delete that entirerow from worksheet. I was going to use a "do until loop" to compare myDte to the date field in a row. But I got stuck right of the bat. Please educate me as to the proper way to code this.

I get "Compile Error: Object required"
 
myDte = Date() + 100

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
i am still getting the compile eroor "Object requrired". my code is now as follows:

Dim myDte As Date
Set myDte = Date + 100
 
Get rid of the Set keyword (ie reread carefully my previous post).

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Excellent! Thank you so much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top