Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
help with vba script lariveesl New Users to Excel 5 June 6th 09 08:53 AM
VBA script Gor_yee Excel Discussion (Misc queries) 1 April 28th 09 10:43 AM
vba script help anthony Excel Programming 2 May 8th 05 06:42 PM
Excel 2000/XP script to Excel97 script hat Excel Programming 3 March 2nd 04 03:56 PM
what is a vb script george Excel Programming 1 July 16th 03 09:56 AM


All times are GMT +1. The time now is 12:02 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"