View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JW[_2_] JW[_2_] is offline
external usenet poster
 
Posts: 638
Default Inserting chr(10) from script

Try:
"This is" & vbLf & "my test" & vbLf & "text."

Gav wrote:
I am writing an OLE link from SAP to generate an Excel document and have
come accross a bit of a hurdle. After populating a cell with text I need to
insert carriage returns at specific points.

eg. I insert "This is my test text." into a cell. Then I want to insert
carriage returns after "is" and "test".

I've tried to record macros of me selecting after a character and pressing
alt-enter but in the macro shows the following "This is"& chr(10) &"my
test"& chr(10) &"text."

Is there an insert command I can use to insert a single character?

thanks

Gav