Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have this function:
Function Qtr2Date(QtrDate As String, TimeLimit As Long) As Date 'Change "1Q06" to a date + 1 Dim LtrPos As Long Dim QtrMonth As Long Dim QtrYear As String Dim YrPlusTerm As Long LtrPos = InStr(UCase(QtrDate), "Q") QtrMonth = Left(QtrDate, LtrPos - 1) QtrYear = Mid(QtrDate, Len(QtrDate) - LtrPos + 1, 2) YrPlusTerm = Abs(QtrYear) + TimeLimit Select Case QtrMonth Case 1 Qtr2Date = Format("4/1/" + Str(Right(YrPlusTerm, 2)), "mm/dd/yy") Case 2 Qtr2Date = Format("7/1/" + Str(Right(YrPlusTerm, 2)), "mm/dd/yy") Case 3 Qtr2Date = Format("10/1/" + Str(Right(YrPlusTerm, 2)), "mm/dd/yy") Case 4 Qtr2Date = Format("12/31/" + Str(Right(YrPlusTerm, 2)), "mm/dd/yy") End Select End Function It returns the date serial number, not the formatted date. The column has mixed data, so I can't format the whole column as a date. What am I missing? Thanks, David |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
conditional formatting for cell date to equal today's date | Excel Worksheet Functions | |||
condtional formatting in office 2007 is not working properly | Excel Discussion (Misc queries) | |||
XL 2007: Conditional formatting not saved properly | Excel Discussion (Misc queries) | |||
the auto date feature is not functioning properly - how to reset | New Users to Excel | |||
Trendline formatting doesn't print or preview properly!? | Charts and Charting in Excel |