Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-22-2021, 04:08 AM
falcios falcios is offline Find and Replace Code Not Working Windows 7 64bit Find and Replace Code Not Working Office 2019
Advanced Beginner
Find and Replace Code Not Working
 
Join Date: Aug 2019
Posts: 48
falcios is on a distinguished road
Default Find and Replace Code Not Working

Hello

This is my sample text
02:20
key and press it again to exit full
02:22
screen tip number four
02:24
you can also use shortcut keys to
02:26

I want to delete the hard returns after the time stamps so that the text moves up next to the timestamp
Also, a colon and space after the timestamp

I was given two formulas
1.
Find and replace with wildcards turned on
Find = (:[0-9]{2})^13
Replace with = \1^t

2. This one was working
Find = ([0-9]:[0-9]{2})^13
Replace = \1:

Both formula's messages are: searched the selection but can't find any matches.



I'm assuming that the equal sign is included in the formula?

What do I need to change in the formulas to get them to work?

Thanks in advance.
Reply With Quote
  #2  
Old 06-22-2021, 05:24 AM
Guessed's Avatar
Guessed Guessed is offline Find and Replace Code Not Working Windows 10 Find and Replace Code Not Working Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,991
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

You need to provide a sample document so we can see what is at the end of the line after the numbers. The advice you were given would work if the number is followed immediately by a carriage return. If there are spaces or soft returns then the code won't work.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #3  
Old 06-22-2021, 05:42 AM
falcios falcios is offline Find and Replace Code Not Working Windows 7 64bit Find and Replace Code Not Working Office 2019
Advanced Beginner
Find and Replace Code Not Working
 
Join Date: Aug 2019
Posts: 48
falcios is on a distinguished road
Default

I have attached an image file with show/hide characters.

I hope this will make sense.

Thanks
Attached Images
File Type: jpg Word Find and Replace.jpg (70.5 KB, 19 views)
Reply With Quote
  #4  
Old 06-22-2021, 05:51 AM
Guessed's Avatar
Guessed Guessed is offline Find and Replace Code Not Working Windows 10 Find and Replace Code Not Working Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,991
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

The replace works fine on my machine. Are you sure you ticked the "Use Wildcards" option in the dialog?
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #5  
Old 06-22-2021, 05:55 AM
falcios falcios is offline Find and Replace Code Not Working Windows 7 64bit Find and Replace Code Not Working Office 2019
Advanced Beginner
Find and Replace Code Not Working
 
Join Date: Aug 2019
Posts: 48
falcios is on a distinguished road
Default

Yes the Use Wildcards is checked
Reply With Quote
  #6  
Old 06-22-2021, 09:55 AM
Charles Kenyon Charles Kenyon is offline Find and Replace Code Not Working Windows 10 Find and Replace Code Not Working Office 2019
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,159
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Try attaching an actual Word document file rather than a picture of a document.
How to attach a screenshot or file in this forum.
Reply With Quote
  #7  
Old 06-22-2021, 11:29 AM
falcios falcios is offline Find and Replace Code Not Working Windows 7 64bit Find and Replace Code Not Working Office 2019
Advanced Beginner
Find and Replace Code Not Working
 
Join Date: Aug 2019
Posts: 48
falcios is on a distinguished road
Default

Thanks Charles for your response.

As per your suggestion, I attached a file with the text, and the find settings.

Hope you can make sense of it.

Thanks in advance.
Attached Files
File Type: docx Find and Replace Example.docx (36.4 KB, 6 views)
Reply With Quote
  #8  
Old 06-22-2021, 04:14 PM
Guessed's Avatar
Guessed Guessed is offline Find and Replace Code Not Working Windows 10 Find and Replace Code Not Working Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,991
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

The find and replace works fine on my machine using the above find strings as well as the one in your Word file.

Replacing with "\1: " also works for me. Note the space after the colon.

I have no idea why this is not working on your machine.

EDIT: Perhaps I do have an idea on why this won't work on your machine. Are you including formatting in either the find or the replace? If you told it to Find Bold for instance then in this case it won't find anything. If you told it to Replace with Bold then the bold will happen but the replace won't.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #9  
Old 06-22-2021, 06:04 PM
falcios falcios is offline Find and Replace Code Not Working Windows 7 64bit Find and Replace Code Not Working Office 2019
Advanced Beginner
Find and Replace Code Not Working
 
Join Date: Aug 2019
Posts: 48
falcios is on a distinguished road
Default

It's seems to be working now.

In the search box I selected all. I don't know if that makes any difference.

Can you tell me what \1: actually does and what it means?
Reply With Quote
  #10  
Old 06-22-2021, 07:12 PM
Guessed's Avatar
Guessed Guessed is offline Find and Replace Code Not Working Windows 10 Find and Replace Code Not Working Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,991
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

\1 means whatever it found that was inside the first (curved) brackets. Because of the wildcards we don't know exactly what was found but the \1 means leave that part as it was.

The colon and the space are exactly that.

Effectively, you are replacing the return with a colon space but only when the return is preceded by a pattern of ##:##
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #11  
Old 06-22-2021, 07:25 PM
falcios falcios is offline Find and Replace Code Not Working Windows 7 64bit Find and Replace Code Not Working Office 2019
Advanced Beginner
Find and Replace Code Not Working
 
Join Date: Aug 2019
Posts: 48
falcios is on a distinguished road
Default

Thanks Guessed for all your help.

By selecting all in the search box, did it make a difference?
Reply With Quote
  #12  
Old 06-23-2021, 12:39 AM
Guessed's Avatar
Guessed Guessed is offline Find and Replace Code Not Working Windows 10 Find and Replace Code Not Working Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,991
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

No, the selection in the dialog has no effect.

But if you have selected a range in the document before opening the dialog that can have an effect if you don't pay attention to the scope of what is searched.

I suspect your earlier issues were either due to some formatting setting
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
Reply

Tags
find and replace



Similar Threads
Thread Thread Starter Forum Replies Last Post
Find and Replace Code Not Working Find and Replace is not working Brigitte Word 7 06-15-2021 05:10 PM
Find and Replace Code Not Working Need VBA code for find and replace between two files ganesang Word VBA 2 09-04-2018 06:00 AM
Find/Replace is not working - Excel 2010 fieldhaven Excel 2 02-19-2014 08:30 AM
Find and Replace Code Not Working Find and Replace not working alance Word 2 01-24-2014 02:11 AM
MS Word Find and Replace not working allenglishboy Word 10 07-25-2012 08:05 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:39 PM.


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