Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 05-06-2016, 09:58 AM
macropod's Avatar
macropod macropod is offline It seems as if wdFindStop isn't working properly Windows 7 64bit It seems as if wdFindStop isn't working properly Office 2010 32bit
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

About the only thing that doesn't work via a Find in tables is when you specify a paragraph break and what you're trying to find has an end-of-cell marker instead - and there's no Find expression for an end-of-cell marker. The code I posted at ExcelForum works just fine with tables otherwise. There are work-arounds for tables; none of them particularly elegant. For example:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim i As Long
With ActiveDocument.Range
  With .Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = InputBox("What is the Text to Find")
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindStop
    .Format = False
    .MatchCase = False
    .MatchWholeWord = False
    .MatchWildcards = False
    .MatchSoundsLike = False
    .MatchAllWordForms = False
    .Execute
  End With
  Do While .Find.Found
    If .Characters.Last.Next = vbCr Then
      i = i + 1
    ElseIf .Information(wdWithInTable) Then
      .End = .End + 1
      If .Characters.Last = .Cells(1).Range.Characters.Last Then i = i + 1
    End If
    .Collapse wdCollapseEnd
    .Find.Execute
  Loop
End With
Application.ScreenUpdating = True
MsgBox i & " instances found."
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
It seems as if wdFindStop isn't working properly Indentation Not Working Properly LaC0saNostra Word 2 02-01-2015 11:35 AM
It seems as if wdFindStop isn't working properly Freeze Pane isn't working properly ep2002 Excel 1 07-27-2014 06:53 PM
Accent symbols not working properly on new computer Binary.tobis Excel 3 04-28-2012 04:49 PM
It seems as if wdFindStop isn't working properly [Publisher] Fonts not working properly pajkul Publisher 1 01-23-2011 07:51 PM
Word 2000 Macro not working properly brianlb Word VBA 1 07-01-2009 07:04 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:25 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