View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Extract Characters


-----Original Message-----
sName = (Left(range("B1"), 3) & Right(range("B1"), 2))

or better:

Function sName (rngS as range) as

string 'or variant
Dim sName As String
sName = (Left(rngS, 3) & Right(rngS, 2))
end Function

Stephen Rasey
Houston
http://excelsig.org
http://wiserways.com


"Jack S" wrote in

message
...

I am trying to Extract characters out of a string and
include them in a file name by using

Dim sName As String
sName = (Left(B1, 3) & Right(B1, 2))

But this does not work.

Any ideas as to what is wrong?

Thanks




.
Thanks for your help.