LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default date range vba code

New to vba. Trying to do a basic date range. If calendar
date is between start date and end date then display date
matches if not then display date doesn't match.

I know its something really simple. Please help.

Sub Macro2()

Dim calendar_dte, start_dte, end_dte As Integer

calendar_dte = Range("E1").Select 'calendar date
start_dte = Range("D1").Select 'Start Date
end_dte = Range("D2").Select 'End Date


If (calendar_dte = start_dte And calendar_dte <= end_dte)
Then
MsgBox "Calendar Date Matches Vacation Range"

Else
MsgBox "Calendar Date Does Not Match Vacation Range"

End If
End Sub
 
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
Code to conditional format all black after date specified in code? wx4usa Excel Discussion (Misc queries) 3 December 26th 08 07:06 PM
Convert a julian gregorian date code into a regular date Robert Excel Worksheet Functions 3 June 13th 06 07:03 PM
How to count dates within a certain range in a column with mutiple date range entries Krisjhn Excel Worksheet Functions 2 September 1st 05 01:59 PM
VB Code Naming a Range (range changes each time) krazylain Excel Programming 4 May 15th 04 12:41 PM
code pasting a date changes date format in current month only Edward[_5_] Excel Programming 0 May 10th 04 06:13 PM


All times are GMT +1. The time now is 06:03 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"