Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 12-15-2024, 04:46 PM
macropod's Avatar
macropod macropod is offline Are all cells in the column empty Windows 10 Are all cells in the column empty Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,521
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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Are all cells in the column empty Calculate average in a column, but ignore empty cells? alnonymous Word 1 08-09-2022 07:46 PM
If a2 is not empty, color empty cells in b2:af2 turkanet Excel 2 08-20-2017 11:00 PM
Apparently empty (blank) cells aren't empty daymaker Excel 3 03-08-2012 03:41 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:35 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft