View Single Post
 
Old 03-19-2022, 02:28 PM
macropod's Avatar
macropod macropod is offline Windows 10 Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,469
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

The conventional way of doing things would be something along the lines of:
Code:
Sub Demo()
Dim Rng As Range
With ActiveDocument.Tables(1)
  Set Rng = .Cell(1, 1).Range
  Rng.End = Rng.End - 1
  .Cell(2, 1).Range.Text = Rng.Text
End With
End Sub
What you need to understand is that the end-of-cell marker (i.e. ¤) consists of two characters but, like a paragraph break, occupies only one character space. Hence, moving the Range end backwards by one character is sufficient to eliminate the end-of-cell marker but, if you're using Len() and the like, you need to deduct two characters for the end-of-cell marker (e.g. Left(.Cell(1, 1).Range.Text, Len(.Cell(1, 1).Range.Text) - 2)).
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote