planetarok
planetarok

Reputation: 25

How to fill a table cell to the end with vba?

If I try to change it, its size is too limited

ActiveDocument.Tables(2).Cell(3, 2).Range = text + " " + String(200,".")

enter image description here

Upvotes: 0

Views: 133

Answers (1)

macropod
macropod

Reputation: 13505

For example:

Sub Demo()
Const Txt As String = "abcdefghijklmnopqrstuvwxyz"
With ActiveDocument.Tables(2).Cell(3, 2)
  .Range.Text = Txt + " " + String(200, ".")
  .Range.FitTextWidth = .Width
End With
End Sub

Upvotes: 1

Related Questions