Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 95
Default Between dates

My end user is prompted to enter a date by
MyValue = InputBox("Which month would you like to review? YYYY_MM", "Central
Analytics")

How can I specify to run a procedure if the date entered falls between
2004_01 and 2004_06?


MyValue = InputBox("Which month would you like to review? YYYY_MM", "Central
Analytics")
If MyValue = "2004_07" Then

Workbooks.Open Filename:="\\Fl-aejf-fs1\Data\Data\RECOVERY\EXLDATA\Loan
Recovery MIS\" & MyValue & "\Gross Placement Batch Tracks\Summary Data\" &
ListBox1.List(i) & " GBT Summary.xls"
Unload UserForm6
End If
If MyValue <= "2004_06" and = "2004_01 Then
Workbooks.Open Filename:= _
"\\Fl-aejf-fs1\Data\Data\RECOVERY\EXLDATA\Loan Recovery MIS\" &
MyValue & "\Gross Placement Batch Tracks\AttorneyBatchTrack " & MyValue &
".xls"
Unload UserForm6
End If

If MyValue <= "2003_12" Then
Msg = "CAP publishing began with 2004_01. Please see a member of the
CAP "
Msg = Msg & "Team for reporting prior to that date"
Title = "Central Analytics"
Config = vbOK
End If


End Sub



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Between dates

Stephanie,

Try something like the following:


Dim M As Integer
Dim Y As Integer
Dim Pos As Integer
Dim S As String
Dim D As Date

S = InputBox("Enter date 'MM_YYYY'")
Pos = InStr(S, "_")
D = DateSerial(CInt(Mid(S, Pos + 1)), CInt(Left(S, 2)), 1)
If D = DateSerial(2004, 1, 1) And D <= DateSerial(2004, 6, 30)
Then
MsgBox "Date OK"
Else
MsgBox "Invalid Date"
End If




--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"StephanieH" wrote in
message
...
My end user is prompted to enter a date by
MyValue = InputBox("Which month would you like to review?
YYYY_MM", "Central
Analytics")

How can I specify to run a procedure if the date entered falls
between
2004_01 and 2004_06?


MyValue = InputBox("Which month would you like to review?
YYYY_MM", "Central
Analytics")
If MyValue = "2004_07" Then

Workbooks.Open
Filename:="\\Fl-aejf-fs1\Data\Data\RECOVERY\EXLDATA\Loan
Recovery MIS\" & MyValue & "\Gross Placement Batch
Tracks\Summary Data\" &
ListBox1.List(i) & " GBT Summary.xls"
Unload UserForm6
End If
If MyValue <= "2004_06" and = "2004_01 Then
Workbooks.Open Filename:= _
"\\Fl-aejf-fs1\Data\Data\RECOVERY\EXLDATA\Loan Recovery
MIS\" &
MyValue & "\Gross Placement Batch Tracks\AttorneyBatchTrack " &
MyValue &
".xls"
Unload UserForm6
End If

If MyValue <= "2003_12" Then
Msg = "CAP publishing began with 2004_01. Please see a
member of the
CAP "
Msg = Msg & "Team for reporting prior to that date"
Title = "Central Analytics"
Config = vbOK
End If


End Sub





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Between dates

If MyValue <= "2004_06" and MyValue = "2004_01" Then

--
Regards,
Tom Ogilvy

"StephanieH" wrote in message
...
My end user is prompted to enter a date by
MyValue = InputBox("Which month would you like to review? YYYY_MM",

"Central
Analytics")

How can I specify to run a procedure if the date entered falls between
2004_01 and 2004_06?


MyValue = InputBox("Which month would you like to review? YYYY_MM",

"Central
Analytics")
If MyValue = "2004_07" Then

Workbooks.Open Filename:="\\Fl-aejf-fs1\Data\Data\RECOVERY\EXLDATA\Loan
Recovery MIS\" & MyValue & "\Gross Placement Batch Tracks\Summary Data\" &
ListBox1.List(i) & " GBT Summary.xls"
Unload UserForm6
End If
If MyValue <= "2004_06" and = "2004_01 Then
Workbooks.Open Filename:= _
"\\Fl-aejf-fs1\Data\Data\RECOVERY\EXLDATA\Loan Recovery MIS\" &
MyValue & "\Gross Placement Batch Tracks\AttorneyBatchTrack " & MyValue &
".xls"
Unload UserForm6
End If

If MyValue <= "2003_12" Then
Msg = "CAP publishing began with 2004_01. Please see a member of the
CAP "
Msg = Msg & "Team for reporting prior to that date"
Title = "Central Analytics"
Config = vbOK
End If


End Sub





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 95
Default Between dates

Perfect. Thanks




"StephanieH" wrote:

My end user is prompted to enter a date by
MyValue = InputBox("Which month would you like to review? YYYY_MM", "Central
Analytics")

How can I specify to run a procedure if the date entered falls between
2004_01 and 2004_06?


MyValue = InputBox("Which month would you like to review? YYYY_MM", "Central
Analytics")
If MyValue = "2004_07" Then

Workbooks.Open Filename:="\\Fl-aejf-fs1\Data\Data\RECOVERY\EXLDATA\Loan
Recovery MIS\" & MyValue & "\Gross Placement Batch Tracks\Summary Data\" &
ListBox1.List(i) & " GBT Summary.xls"
Unload UserForm6
End If
If MyValue <= "2004_06" and = "2004_01 Then
Workbooks.Open Filename:= _
"\\Fl-aejf-fs1\Data\Data\RECOVERY\EXLDATA\Loan Recovery MIS\" &
MyValue & "\Gross Placement Batch Tracks\AttorneyBatchTrack " & MyValue &
".xls"
Unload UserForm6
End If

If MyValue <= "2003_12" Then
Msg = "CAP publishing began with 2004_01. Please see a member of the
CAP "
Msg = Msg & "Team for reporting prior to that date"
Title = "Central Analytics"
Config = vbOK
End If


End Sub



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
Linking computer dates (time) to spreadsheet dates that have formu bigisle Excel Worksheet Functions 3 January 3rd 10 08:05 PM
compare 2 tables of dates to find the preceding dates Babi Excel Worksheet Functions 3 October 28th 08 05:52 AM
Identifying unique dates in a range of cells containing dates... cdavidson Excel Discussion (Misc queries) 4 October 13th 06 03:30 PM
Identifying unique dates within a range of cells containing dates cdavidson Excel Discussion (Misc queries) 0 October 12th 06 08:19 PM
need to convert list of dates to count no. of dates by week neowok Excel Worksheet Functions 13 January 30th 06 03:54 PM


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