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 / Excel / Programming / September 2007

Tip: Looking for answers? Try searching our database.

Find function using chr

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
gazza67 - 13 Sep 2007 08:06 GMT
Hi,

I have a single cell with text that contains multiple lines (ie text
separated by a chr(10) I think).

I want to get the text from the cell starting with the first character
up untill but not including the first chr(10).

I presume you use a combination of LEFT , FIND and CHR(10) - but I
just cant seem to get the syntax right.

Could anyone out there help me with this simple problem?

Gary
OssieMac - 13 Sep 2007 08:42 GMT
Hi Gary,

Not sure if you want a worksheet formula or a VBA formula because the post
is in a programming forum and examples are worksheet so here is both:-

Worksheet formula assuming cell A1 has the value:-
=LEFT(A1,FIND(CHAR(10),A1)-1)

VBA formula assuming cell A1 has the value:-
Dim strTest as String
strTest = Left(Range("A1"), InStr(1, Range("A1"), Chr(10)) - 1)

Regards,

OssieMac
 
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.