I am looking for a simple VBA code, to search excel sheet2 for a string "0000X000xx1" and color all of them in red if found in cells.
Then extend the string color forward and backward until a line break is found.
I am looking for a simple VBA code, to search excel sheet2 for a string "0000X000xx1" and color all of them in red if found in cells.
Then extend the string color forward and backward until a line break is found.
Last edited by trueb; 09-16-2022 at 04:20 AM.
Hi trueb,
Is there always a space between the string you want to search & other strings or it could be all connected? Normally such questions tend to be more complex once all variations/cases are identified. I suggest that you post a sample file with clear examples of before (current setup) & after (expected results) for the members to be able to provide you the required code instead of members wasting their time & efforts on unnecessary codes ...
This red snippet below...Was deceiving as it looked like a line break, but was not...Please Login or Register to view this content.
Untitled.png
Last edited by Sintek; 09-16-2022 at 04:26 AM.
Good Luck...
I don't presume to know what I am doing, however, just like you, I too started somewhere...
One-day, One-problem at a time!!!
If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
Also....Add a comment if you like!!!!
And remember...Mark Thread as Solved...
Excel Forum Rocks!!!
Try below code ...
Please Login or Register to view this content.
If I was able to help, you can thank me by clicking the * Add Reputation under my user name
Thank you. without coloring, if I want to delete everything that is forward and backward of 0000X000xx1 until a line break is found then how the code can be modified?
Last edited by trueb; 09-16-2022 at 04:55 AM.
Thanks for the Rep+ ... Try below code
Please Login or Register to view this content.
Ok, try below updated code
Please Login or Register to view this content.
If I want to copy and paste everything in the next column rows respectively that is forward and backward of 0000X000xx1 until a line break is found then how the code can be modified?
Last edited by trueb; 09-26-2022 at 04:14 PM.
If I want to run the same VBA in a text or CSV file how to modify the VBA?
Last edited by trueb; 09-17-2022 at 12:37 PM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks