View Single Post
 
Old 05-26-2022, 06:20 AM
abonsey abonsey is offline Windows 11 Office 2021
Novice
 
Join Date: May 2022
Posts: 6
abonsey is on a distinguished road
Default 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 "
Reply With Quote