Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You're right that I didn't need it - but CStr doesn't add a space:
Dim myVal As Long myVal = 2314 MsgBox Len(myVal) = Len(CStr(myVal)) Could you post code that shows that it does? HTH, Bernie MS Excel MVP wrote in message oups.com... Bernie Deitrick wrote: mike (who apparently doesn't like capital letters) Dim MonthEndDate As Date Dim MonthEndName As String MonthEndDate = DateValue("6-30-05") MonthEndName = CStr(Format(MonthEndDate, "mdyy")) MsgBox MonthEndName HTH, Bernie MS Excel MVP I think I must be being pretty dumb, but doesn't Format return a string? Why use CStr? Plus, CStr rather idioticaly adds a space to the left of the string, so if you do need to use it, you should use: MonthEndName = LTrim(CStr(Format(MonthEndDate, "mdyy"))) Iain |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Need to change numbers with dashes to numbers with no dashes | Excel Discussion (Misc queries) | |||
How do I strip just numbers from an alphanumeric cell? | Excel Worksheet Functions | |||
removing dashes from numbers | Excel Worksheet Functions | |||
Convert phone numbers with dashes in them to just numbers | Excel Discussion (Misc queries) | |||
Convert phone numbers with dashes in them to just numbers | Excel Discussion (Misc queries) |