InputBox Date Value
Not working.
--
Thanks,
Vikram P. Dhemare
"Rick Rothstein" wrote:
You could check how many forward slashes are in myDate and if only one,
patch a day value into the string so date can be parsed/formatted correctly.
I'm thinking that immediately after the user gives you his/her date via the
InputBox, you could do this...
If UBound(Split(myDate, "/")) = 1 Then myDate = "01/" & mdDate
and then continue with the rest of your code. I'm assuming in some part of
the rest of your code, you check to make sure you have a legitimate date.
--
Rick (MVP - Excel)
"Vikram Dhemare" wrote in message
...
Hi all,
I have created a inputbox where user has to put the date, the default
value
is Cdate i.e today's date in DD/MM/YYYY format.
The variable report date is set according to the input box. Upto here, its
working fine. I am getting the desired report.
But if the user only enter the month & year in the input box, the system
itself define the variable to first date of the month, which i dont want.
in
this case the variable should set only for mm/yyyy & not the dd/mm/yyyy
Can it be possible as I have created a report based on this. such as if
user
wants the output for the particular date, user must enter the desired date
and if user want the output for the particular month then inputbox value
must
return the datevalue for month & year.
Sub Tester()
Dim myDate As Date
myDate = Application.InputBox(Prompt:="Enter the Report Date", _
Title:="Date Parameter !", Default:=Format(CLng(Date),
"DD/MM/YYYY")) Here (in the inputbox) if I put the value 06/2008 then
dateValue should return for the month of Jun 2008 but the value is
returning
01/Jun/2008 And if I put the datevalue as 06/09/2008 then datevalue should
return 06/sept/2008.
MsgBox (myDate)
End Sub
I am using this for sumproduct function.
Application.Evaluate("=sumproduct(('Issue'!D2:D655 00= """ _
& myCell.Value & """ )*('Issue'!B2:B65500 =" & RptDt &
"),('Issue'!G2:G65500))")
Plz. help.
--
Thanks,
Vikram P. Dhemare
|