Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a variable called "TmpVal" and it can be anything.
It will always have a "." in the value. How do I make it show the value up to the very first "." going from left to right? Thank you Todd Huttenstine |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
For x = Len(TmpVal) To 1 Step -1
If Mid(TmpVal, x, 1) = "." Then prd = x End If Next x Cells(1, 1).Value = Left(TmpVal, prd - 1) - Piku -- Message posted from http://www.ExcelForum.com |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Have a look in vba help index for instr
-- Don Guillett SalesAid Software "Todd Huttenstine" wrote in message ... I have a variable called "TmpVal" and it can be anything. It will always have a "." in the value. How do I make it show the value up to the very first "." going from left to right? Thank you Todd Huttenstine |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Or...
Do prd = prd + 1 Loop Until Mid(TmpVal, prd, 1) = "." Cells(1, 1).Value = Left(TmpVal, prd - 1) That's more compact... - Piku -- Message posted from http://www.ExcelForum.com |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Cells(1, 1).Value = Left(TmpVal, InStr(TmpVal, ".") - 1)
even better. I'm sad I didn't think about that one. :-( I just insist on going about things the long way... - Piku -- Message posted from http://www.ExcelForum.com |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
since you said left to right, better yet to try using instrrev
Why? Left to right would be the normal way, so instr should be just fine. -- Regards, Tom Ogilvy "Don Guillett" wrote in message ... since you said left to right, better yet to try using instrrev -- Don Guillett SalesAid Software "Don Guillett" wrote in message ... Have a look in vba help index for instr -- Don Guillett SalesAid Software "Todd Huttenstine" wrote in message ... I have a variable called "TmpVal" and it can be anything. It will always have a "." in the value. How do I make it show the value up to the very first "." going from left to right? Thank you Todd Huttenstine |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Long day
-- Don Guillett SalesAid Software "Tom Ogilvy" wrote in message ... since you said left to right, better yet to try using instrrev Why? Left to right would be the normal way, so instr should be just fine. -- Regards, Tom Ogilvy "Don Guillett" wrote in message ... since you said left to right, better yet to try using instrrev -- Don Guillett SalesAid Software "Don Guillett" wrote in message ... Have a look in vba help index for instr -- Don Guillett SalesAid Software "Todd Huttenstine" wrote in message ... I have a variable called "TmpVal" and it can be anything. It will always have a "." in the value. How do I make it show the value up to the very first "." going from left to right? Thank you Todd Huttenstine |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Find first period from the right | Excel Discussion (Misc queries) | |||
Find Period Date? | Excel Discussion (Misc queries) | |||
pay back period | Excel Discussion (Misc queries) | |||
3 lates in any 35 day period. | Excel Discussion (Misc queries) | |||
Period to Period percentage change? | Excel Discussion (Misc queries) |