Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-13-2020, 09:40 AM
Cendrinne's Avatar
Cendrinne Cendrinne is offline Help with WildCards Find & Replace either or nothing... Windows 10 Help with WildCards Find & Replace either or nothing... Office 2019
Competent Performer
Help with WildCards Find & Replace either or nothing...
 
Join Date: Aug 2019
Location: Montreal Quebec Canada
Posts: 190
Cendrinne is on a distinguished road
Default Help with WildCards Find & Replace either or nothing...


I need help, insights. Been searching for answers, even here in the forum of already discussed, and I don't seem to find it.

I've recently learned how to put different options in the last box, example below :

[0-9]{1;}[*,.] // [\(][0-9]{1;}[\)][*,.]

What I'm searching for is: 2, 4, 5 // (space then numbers 0-9, with a comma, and just a number at the end.)

Would be the same thing with (2), (4), (5).// (same explanation as above, exept with a parenthese).

and / or
either a space before or nothing, then (4), (5), (6), (7) /// (NO space before the (4))

So what am I to do, when the last digit needs no coma or )? I thought the * would resolve this, since it's 0 charactere or more than 1, but it ignores the last digit in a cell.

BTW, these are at the end of the cells, are like references, where I want to delete them.

Any help? What am I doing wrong?

Cendrinne
Reply With Quote
  #2  
Old 11-13-2020, 02:16 PM
macropod's Avatar
macropod macropod is offline Help with WildCards Find & Replace either or nothing... Windows 10 Help with WildCards Find & Replace either or nothing... Office 2010
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
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

Your description is ambiguous. Some actual examples would be helpful.

For what you describe, you might try something like:
Find = (2, 4, 5 // )(\([0-9]@,[0-9]@\))
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 11-13-2020, 06:00 PM
Cendrinne's Avatar
Cendrinne Cendrinne is offline Help with WildCards Find & Replace either or nothing... Windows 10 Help with WildCards Find & Replace either or nothing... Office 2019
Competent Performer
Help with WildCards Find & Replace either or nothing...
 
Join Date: Aug 2019
Location: Montreal Quebec Canada
Posts: 190
Cendrinne is on a distinguished road
Default

I'm so sorry Paul, I thought I was clear. Good to know, I'll try to do better next time.

I'm not certain how to word it, so, I'll give you many intances of references at the end of the sentences.

I'm wondering if you could find ALL of these different instances in one session of Manual Find and Replace (go to next) or do I have to do many different Manual Find and Replaces to successfully highlight all of the references (alphanumerical values)?

See below. Some have space before the first alphanumerican value, some starts with an open brackets, others have space and commas in between values, others have only commas, and some have open and closed brakets.

Is it possible to find them all? I've tested many different ways, with wildcards, wanted to highlight them, but only a few values where found, not all of them. Unless I do multiple Find and Replaces.

Lorem ipsum dolor sit amet, magna aliqua (3,6,2)
Lorem ipsum dolor sit amet, magna aliqua3), 6), 2)
Ut enim ad minim veniam, quis nostrud (i)
Ut enim ad minim veniam, quis nostrud(i), (ii), (iii)
Duis aute irure dolor reprehenderit in voluptate velit (2)
Duis aute irure dolor reprehenderit in voluptate velit 2)
Duis aute irure dolor reprehenderit in voluptate velit(2)
Duis aute irure dolor reprehenderit in voluptate velit2)
Lorem ipsum dolor sit amet, magna aliqua 3,6,2
Lorem ipsum dolor sit amet, magna aliqua3, 6, 2

Is my explanation a little clearer? And is it doable, cause I'm ALWAYS missing a bunch of them.

Any insights, I would be so ever greatful
Reply With Quote
  #4  
Old 11-13-2020, 07:35 PM
macropod's Avatar
macropod macropod is offline Help with WildCards Find & Replace either or nothing... Windows 10 Help with WildCards Find & Replace either or nothing... Office 2010
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
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

Try:
Find = [\(0-9i]@[\(0-9i, \)]{1,}
or:
Find = [\(0-9i]@[\(0-9i, \)]{1;}
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 11-13-2020, 07:49 PM
Cendrinne's Avatar
Cendrinne Cendrinne is offline Help with WildCards Find & Replace either or nothing... Windows 10 Help with WildCards Find & Replace either or nothing... Office 2019
Competent Performer
Help with WildCards Find & Replace either or nothing...
 
Join Date: Aug 2019
Location: Montreal Quebec Canada
Posts: 190
Cendrinne is on a distinguished road
Default

OMG, YES, it works. How did you figure it out??? The second one in my case, probably because my keyboard is in French or it's my layout. I've tried so long Trial and Error, and I got so many error, but you figured it out.

I'm am truly greatful.

Thank you
Reply With Quote
  #6  
Old 11-13-2020, 07:54 PM
macropod's Avatar
macropod macropod is offline Help with WildCards Find & Replace either or nothing... Windows 10 Help with WildCards Find & Replace either or nothing... Office 2010
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
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

Quote:
Originally Posted by Cendrinne View Post
How did you figure it out???
Experience, care & attention...
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 11-13-2020, 08:04 PM
Cendrinne's Avatar
Cendrinne Cendrinne is offline Help with WildCards Find & Replace either or nothing... Windows 10 Help with WildCards Find & Replace either or nothing... Office 2019
Competent Performer
Help with WildCards Find & Replace either or nothing...
 
Join Date: Aug 2019
Location: Montreal Quebec Canada
Posts: 190
Cendrinne is on a distinguished road
Default

Hummmmm, I've tried to add a-i, and it picked up letters at the start of the sentences.

[\(0-9a-i]@[\(0-9a-i, \)]{1;}

Duis aute irure dolor reprehenderit in voluptate velit2)
Ut enim ad minim veniam, quis nostrud (a)
Ut enim ad minim veniam, quis nostrud(a), (b), (c)
Ut enim ad minim veniam, quis nostrud a), b), c)

without telling me the full solution, could you guide me as to what I need to look for?

Cendrinne
Reply With Quote
  #8  
Old 11-13-2020, 08:40 PM
macropod's Avatar
macropod macropod is offline Help with WildCards Find & Replace either or nothing... Windows 10 Help with WildCards Find & Replace either or nothing... Office 2010
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
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

Even with the Find expression from my previous reply there is the risk of false matches. For example:
Ut enim ad minim veniam, quis nostri (i), (ii), (iii)
Duis aute irure dolor reprehenderit in voluptate veli(2)
Lorem ipsum dolor sit amet, magna aliqui 3,6,2

Accordingly, in either case you need to check what is found.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #9  
Old 11-13-2020, 08:47 PM
Cendrinne's Avatar
Cendrinne Cendrinne is offline Help with WildCards Find & Replace either or nothing... Windows 10 Help with WildCards Find & Replace either or nothing... Office 2019
Competent Performer
Help with WildCards Find & Replace either or nothing...
 
Join Date: Aug 2019
Location: Montreal Quebec Canada
Posts: 190
Cendrinne is on a distinguished road
Default

OK Thanks Paul. Been trying since my message and I couldn't come up with the solution. So now I know, at times, there is No formula that fits all instances. And we need to validate the query.

I'm deeply grateful Paul, Have yourself a great evening

P.S.: by the way, I'll be taking a course soon, for beginners. I know I'm more advance than beginners, but I need to fill up grey areas, cause I've learned by analyzing, but missing some key basic component.

Reply With Quote
  #10  
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,427
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
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

Thread Tools
Display Modes


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:22 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft