![]() |
|
#1
|
|||
|
|||
![]()
So that worked brilliantly, well happy, but the codes i have tried for the delete empty cells returns the error 5991, cannot access the individual rows in this collection, because the table vertically merged cells.
Is there a workaround Thanks Matt What I'd really want is if the cell only contains "info:" then delete the/ remove the cell, this is because no answer has been returned, so therefore we dont want spaces everywhere. Thanks Again Matt |
#2
|
||||
|
||||
![]()
It does, if 'Info:' the only thing in the cell. You asked for a macro that works as follows
Quote:
Code:
Sub Demo() Application.ScreenUpdating = False With ActiveDocument.Range With .Find .ClearFormatting .Replacement.ClearFormatting .Format = False .Forward = True .Wrap = wdFindContinue .Text = "[\[\]\*“”""""]" .MatchWildcards = True .Replacement.Text = "" .Execute Replace:=wdReplaceAll .Text = "Info[: ^s.^t^13]{1,}" .Replacement.Text = "" .Wrap = wdFindStop End With Do While .Find.Execute If .Information(wdWithInTable) = True Then If .End = .Cells(1).Range.End - 1 Then .Rows.Delete End If .Collapse wdCollapseEnd Loop End With Application.ScreenUpdating = True End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
![]() |
Tags |
ctrlh, dunce, vba |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
mackied | Word VBA | 9 | 07-30-2017 03:10 PM |
![]() |
tonydoneese | Excel | 4 | 01-12-2016 07:41 AM |
Strange Characters appear when selecting SHOW ALL NON PRINTING CHARACTERS | ann Amber | Word | 1 | 08-01-2015 08:06 PM |
Junk characters (box-like characters) in Word file | Sashikala | Word | 1 | 04-20-2010 02:03 PM |
Removing data between two characters | Voodoo Child | Excel | 1 | 11-26-2009 01:39 PM |