View Single Post
 
Old 12-15-2024, 04:46 PM
macropod's Avatar
macropod macropod is online now 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

That depends on how you're going about it. For a designated table & column, you could use something based on:
Code:
Sub CheckTableData()
Application.ScreenUpdating = False
Dim t As Long, c As Long, r As Long, l As Long, bFit As Boolean
With ActiveDocument
  If .Tables.Count = 0 Then Exit Sub
  t = InputBox("Which table?" & vbCr & "Choose from 1 to " & .Tables.Count, , 1)
  c = InputBox("Which column?" & vbCr & "Choose from 1 to " & .Tables(t).Columns.Count, , 1)
  With .Tables(t)
    bFit = .AllowAutoFit
    .AllowAutoFit = False
    For r = 1 To .Rows.Count
      l = l + Len(.Cell(r, c).Range.Text) - 2
    Next
    .AllowAutoFit = bFit
  End With
End With
MsgBox l
Application.ScreenUpdating = True
End Sub
If you know the table # and column #, you could hard-code those.

In each case, the macro returns how may text characters are in the designated cells.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote