extra space in Dear Jim code in letter using full contact name

M

magmike

Here is the code for my greeting line a report/letter:

=("Dear " & Left([SentTo],InStr([SentTo]," ")) & ":")

Which will turn Jim Jones to Dear Jim :

How do I get rid of the extra space?
 
G

George Nicholson

Left([SentTo],InStr([SentTo]," ")-1)
or Trim(Left([SentTo],InStr([SentTo]," ")))
 
O

Ofer Cohen

Try

=("Dear " & Left([SentTo],InStr([SentTo]," ")-1) & ":")

Or
=("Dear " & Trim(Left([SentTo],InStr([SentTo]," "))) & ":")
 
Top