Inserting chr(10) from script

G

Gav

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
 
G

Gav

Gav said:
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

I thought that would happen. Half an hour getting knowhere then as soon as I
post I find the answer. :blush:)

ActiveCell.Characters(6, 0).Insert (Chr(10))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top