View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Final space removed when moving to Object variable

Use the trim function

either
strLet = trim("ABCD ") 'ABCD and a final space

or
obHead.Value("OBJ") = trim(strLet) "obHead.Value("OBJ") contains ABCD

"groupie" wrote:

Is there a solution to this problem? The final space in a String is
deleted when assigned to a field in an Object variable.


Dim obHead As Object
Dim strLet As String

strLet = "ABCD " 'ABCD and a final space

obHead.Value("OBJ") = strLet "obHead.Value("OBJ") contains ABCD
(no space)


Thanks for any assistance!