#1
|
|||
|
|||
replace cell text results in extra carriage return
I have a snippet of vba to insert a mixture of variable, other cell values and static text into a new cell Looking at the code below the result is the variable 'FullBoxes' and the contents from 'ActiveDocument.Tables(1).Cell(1, 3).Range' are on one line but the wording "containing" begins on another line. What causes that and how do I stop what is effectively a carriage return being applied. TIA With ActiveDocument.Tables(1).Cell(i, 3).Range .Font.Name = "Arial" .Font.Size = 10 If Remaining > 0 Then .Text = FullBoxes & " " & ActiveDocument.Tables(1).Cell(1, 3).Range & " containing " |
#2
|
||||
|
||||
That's because a cell's range includes the end-of-cell marker - which ordinarily looks like the '¤' symbol.
One approach would be to use: Code:
Text = FullBoxes & " " & Split(ActiveDocument.Tables(1).Cell(1, 3).Range.Text, vbCr)(0) & " containing "
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Thanks. That worked Brilliantly
|
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to split values from carriage-return from the cell | ganesang | Excel | 3 | 12-02-2019 07:16 AM |
Find / Replace hard Carriage Return with Line break. | GreenBoy | Word | 2 | 03-11-2018 02:32 AM |
carriage return on PPT | yangthomson | PowerPoint | 0 | 04-21-2016 07:16 PM |
Adding a carriage return at end of each line, and then a blank space, after text entry complete | CEMurphy4 | Word VBA | 1 | 12-02-2015 11:53 PM |
Plain Text Content Control - Losing Styling on Carriage Return | kintap | Word | 0 | 07-16-2014 12:43 PM |