Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.tables
cepes cepes is offline
external usenet poster
 
Posts: 1
Default Word: Delete Table Row if Column B is Empty

Hi:
I have a Word table with labels in Column A and merged data in Column B.

I need to add VBA so that if Column B is empty, the entire row is deleted.

Thanks-

Charlie

Word 2007
  #2   Report Post  
Posted to microsoft.public.word.tables
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Delete Table Row if Column B is Empty

Use the following:

Dim i As Long
With Selection.Tables(1)
For i = .Rows.Count To 1 Step -1
If Len(.Cell(i, 2).Range.Text) = 2 Then
.Rows(i).Delete
End If
Next i
End With


--
Hope this helps,

Doug Robbins - Word MVP

Please reply only to the newsgroups unless you wish to obtain my services on
a paid professional basis.

"cepes" wrote in message
...
Hi:
I have a Word table with labels in Column A and merged data in Column B.

I need to add VBA so that if Column B is empty, the entire row is deleted.

Thanks-

Charlie

Word 2007


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Empty page after column break LisaK Page Layout 1 July 14th 09 05:49 PM
Need help with MS word 2003 - How do I delete an empty page? Learner Microsoft Word Help 3 April 28th 08 06:48 PM
How to delete empty page after table jknapp1005 Tables 1 August 17th 06 11:29 PM
delete empty document in word terstecats Mailmerge 1 August 4th 05 10:18 PM
How does one delete an empty page at the end of a Word document? . jhltampa Microsoft Word Help 2 January 9th 05 06:50 PM


All times are GMT +1. The time now is 07:53 AM.

Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.
Copyright 2004-2023 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"