• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Excel vba to check if nth line or lines of word doc are empty & delete

kiran5

New Member
Hi guys,
I have done a macro automation and now I am stuck in one place.
Its an excel macro where I have some data on multiple cells and with that I automaticallt open a word template and updates excel cell information in the bookmarks placed in the document. VBA already does this everything. But the challenge now is the excel VBA should check if my 17,18 &19th line of the word document is empty n if it is empty then delete those lines. If any one of these lines also empty then delete those lines.

ple suggest
 
Hi, kiran5!
You can test this:
wd.Paragraphs(I).Range.Characters.Count
which holds the number of characters that the I-th paragraph of the document has. Remember that even if an empty line, the paragraph will still have one character: the line separator.
Regards!
 
Back
Top