Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Linking computer dates (time) to spreadsheet dates that have formu | Excel Worksheet Functions | |||
compare 2 tables of dates to find the preceding dates | Excel Worksheet Functions | |||
Identifying unique dates in a range of cells containing dates... | Excel Discussion (Misc queries) | |||
Identifying unique dates within a range of cells containing dates | Excel Discussion (Misc queries) | |||
need to convert list of dates to count no. of dates by week | Excel Worksheet Functions |