View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
rfusee rfusee is offline
external usenet poster
 
Posts: 10
Default OK, I simplified my problem a bit, smart people sound off!!!!!

unfortunately that won't help me in this scenario. Ultimately what I'm
really doing is pasting this text into an Access text box which is part of a
much larger template which auto-generates contracts for me.

" wrote:

On 20 Sep, 16:30, rfusee wrote:
Guys,

3rd post on this now, and I have narrowed my problem down to this:

Function test () as String

test = "line1" & vbLf & "line2"

End

This function shows this in my Excel cell...

line1
line2

If I cut and paste it into notepad, it shows this...

"line1
line2"

I need to get rid of those quotation marks. If I take the vbLf out, i get
line1line2 and when I cut and paste there are NO quotation marks, so I know
it has to do with the fact that I put in the vbLf.

Is there ANY way I can still have my text formatted with carriage returns
when I cut and paste into Notepad WITHOUT getting those annoying quotation
marks?


Hi,

What about outputting directly to the text file rather than cutting
and pasting?

Function test() As String
Open "C:\Test.txt" For Output As #1
Print #1, "line1"
Print #1, "line2"
Close #1
End Function

This will then put in your text file:
Line1
Line2

James