Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / October 2006

Tip: Looking for answers? Try searching our database.

Search string beginning at the end

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Frederick Lorca - 04 Oct 2006 05:36 GMT
I tried to find the answer to my question in this newsgroup's Google archive
but didn't find anything specific to my question.

Suppose I have a string that's 40 characters in length.  Starting from the
end of the string, I want to search backwards to find the first occurence of
a blank space.  How do I do this?  Also, what is the Chr number for a blank
space?

Frederick Lorca
Tony Jollans - 04 Oct 2006 11:06 GMT
Provided you have Word 2000 or later you can use InStrRev

   TestString = "Forty characters of text as illustration"
   Msgbox "The last space is at position " & InStrRev(TextString, " ")

--
Enjoy,
Tony

> I tried to find the answer to my question in this newsgroup's Google archive
> but didn't find anything specific to my question.
[quoted text clipped - 5 lines]
>
> Frederick Lorca
Frederick Lorca - 05 Oct 2006 03:52 GMT
Thank you.

> Provided you have Word 2000 or later you can use InStrRev
>
[quoted text clipped - 18 lines]
>>
>> Frederick Lorca

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.