View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
keepITcool keepITcool is offline
external usenet poster
 
Posts: 2,253
Default Position of Chr(10)



in a worksheetfunction you'd use the search or find function
=SEARCH(CHAR(10),a1)

in VBA:

use the InStr function.
dim iPos%
ipos = instr("where's the linefeed", vblf)

xl2000 and newer also have an InstrRev() function
which search from the end of the string to give you the LAST occurance
of the substring.

note:
vblf is a constant used in VB(a) for chr(10)
vbcr = chr(13)

see VBA help for the full monty.


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Zurn wrote :


I have a string with *Chr(10)* in it.

I want to know the position of this Chr(10) so I can cut off the
string starting from this Chr(10).

What function gives this position?

Thx