View Single Post
 
Old 08-24-2022, 04:59 PM
macropod's Avatar
macropod macropod is offline Windows 10 Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

Better (IMHO)
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim Rng As Range
With Selection
  If .Information(wdWithInTable) = True Then
    Set Rng = .Cells(1).Range
    Rng.End = Rng.End - 1
    MsgBox Rng.Text
  Else
    MsgBox "The selection is not in a table", vbCritical
  End If
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote