Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Help with Date checking code

How would I change
this condidtion to check for a value
whe

PLEXP is = Date and
the Month of PLEXP is <= Next Month

Also taking into consideration a Dec/Jan
value combination. (PLEXP Month is Dec)

If ((DateValue(PLEXP) = Date) And _
(DatePart("M", DateValue(PLEXP)) <= _
(DatePart("M", Date) + DatePart("M", Date) + 1))) Then

I can't quite get it right. Not used to VBA.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Help with Date checking code

If ((DateValue(PLEXP) = Date) And _
(DateValue(PLEXP) <= _
DateSerial(year(Date),Month(Date)+2,0)) Then

I think you would run into problems at for the Dec Jan time frame if you
just check on Month, so This checks if the PLEXP is <= the last day of the
next month. I believe that will achieve your ends.

--
Regards,
Tom Ogilvy


"Mr. Clean" wrote in message
om...
How would I change
this condidtion to check for a value
whe

PLEXP is = Date and
the Month of PLEXP is <= Next Month

Also taking into consideration a Dec/Jan
value combination. (PLEXP Month is Dec)

If ((DateValue(PLEXP) = Date) And _
(DatePart("M", DateValue(PLEXP)) <= _
(DatePart("M", Date) + DatePart("M", Date) + 1))) Then

I can't quite get it right. Not used to VBA.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Help with Date checking code

In article ,
says...
If ((DateValue(PLEXP) = Date) And _
(DateValue(PLEXP) <= _
DateSerial(year(Date),Month(Date)+2,0)) Then

Thanks, That works great...
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
evnet code, checking for entry Tami Excel Worksheet Functions 3 December 19th 09 04:59 PM
Checking and Unchecking CheckBoxes in code Ayo Excel Discussion (Misc queries) 0 April 3rd 09 08:41 PM
Color Code Date Checking drvortex Excel Worksheet Functions 3 February 1st 06 07:34 AM
Checking with code to see if a Workbook is Protected? debartsa Excel Programming 1 January 21st 04 03:40 PM
Checking for existence of macros or code in an Excel Spreadsheet Youssef Mourra Excel Programming 3 August 13th 03 05:13 PM


All times are GMT +1. The time now is 09:58 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"