Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Inserting chr(10) from script
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Inserting chr(10) from script
"Gav" wrote in message ... 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. :o) ActiveCell.Characters(6, 0).Insert (Chr(10)) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
help with vba script | New Users to Excel | |||
VBA script | Excel Discussion (Misc queries) | |||
vba script help | Excel Programming | |||
Excel 2000/XP script to Excel97 script | Excel Programming | |||
what is a vb script | Excel Programming |