Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
spaces
Hi all, how do I find the first space from the right or the last space from
the left in a string of 30 chars e.g. "the rainfall is very heavy thi" Thanks as always -- delmac |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
spaces
Hi Delmac,
Try something like: '============= Public Sub Tester() Dim iPos As Long Const sStr As String = "the rainfall is very heavy thi" iPos = InStrRev(sStr, Space(1)) MsgBox iPos End Sub '<<============= --- Regards, Norman "delmac" wrote in message ... Hi all, how do I find the first space from the right or the last space from the left in a string of 30 chars e.g. "the rainfall is very heavy thi" Thanks as always -- delmac |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
spaces
Hi Delmac,
I should have added that, IIRC, the InStrRev was introduced in xl2K. --- Regards, Norman |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
spaces
Hello
Use InstrRev. eg: InStrRev("the rainfall is very heavy thi", " ", -1, vbTextCompare) This will return the position of the first space found strating from the right. HTH Cordially Pascal "delmac" a écrit dans le message de news: ... Hi all, how do I find the first space from the right or the last space from the left in a string of 30 chars e.g. "the rainfall is very heavy thi" Thanks as always -- delmac |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how do I remove leading spaces and leave the remianing spaces w | Excel Worksheet Functions | |||
Spaces | Excel Worksheet Functions | |||
spaces not recognized as spaces | Excel Worksheet Functions | |||
Help copying a range with spaces to a range without spaces | Excel Programming | |||
Spaces | Excel Programming |