Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-14-2020, 08:25 AM
gmaxey gmaxey is offline Help with WildCards Find & Replace either or nothing... Windows 10 Help with WildCards Find & Replace either or nothing... Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Perhaps a different approach. This works for your example:




Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oRng As Range
Dim oCell As Cell
  For Each oCell In Selection.Tables(1).Range.Cells
    Set oRng = oCell.Range
    If Len(oCell.Range.Text) > 2 Then
      oRng.Collapse wdCollapseEnd
      oRng.Move wdCharacter, -1
      Do Until oRng.Characters.First.Previous Like "[A-Za-hj-uwyz.]"
        'the Roman numberals could be a problem but few words end in 'i, v or x"
        oRng.Select
        oRng.MoveStart wdCharacter, -1
      Loop
      oRng.HighlightColorIndex = wdBrightGreen 'or delete the range
    End If
  Next
lbl_Exit:
  Exit Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/

Last edited by gmaxey; 11-14-2020 at 04:23 PM.
Reply With Quote
Reply

Tags
find & replace w/ nothing



Similar Threads
Thread Thread Starter Forum Replies Last Post
Advanced Find and Replace with Wildcards help needed Amapola188 Word 3 07-23-2019 10:54 PM
Help with WildCards Find & Replace either or nothing... Find and replace text with wildcards arunchandar9 Word VBA 15 06-30-2019 01:06 AM
Help with WildCards Find & Replace either or nothing... Dissecting a hyperlink with Find Replace Wildcards WeyldFalcon Word 4 11-15-2016 12:48 PM
Using wildcards how do I Find and Add to, not replace Stargehzer Word 3 01-25-2016 09:14 PM
Find & Replace: Wildcards (except this pattern) tinfanide Word 6 01-26-2014 06:39 AM

Other Forums: Access Forums

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