Batch delete all text that appears between NAME#1 and NAME#2 in text file.

sr1111

New Member
Joined
Sep 2, 2022
Messages
46
Office Version
  1. 2013
  2. 2011
  3. 2010
  4. 2007
Platform
  1. Windows
Batch delete all text that appears between NAME#1 and NAME#2 in a text file.
The VBA should begin after the NAME#1 data ends and come to an end before the NAME#2 line.

An example of the input and output of a text file is below:
Input text.text fileOutput text.text file
1. How to copy text in rows betwen numbers from a text file. How to copy text in rows NAME#1 betwen numbers from a text file. How to copy text in rows betwen numbers from a text file.% content1 content2 content3 NAME#2 How to copy text in rows betwen numbers from a text file.1. How to copy text in rows betwen numbers from a text file. How to copy text in rows NAME#1 betwen numbers from a text file. How to copy text in rows betwen numbers from a text file. content3 NAME#2 How to copy text in rows betwen numbers from a text file.
3. How to copy text in rows NAME#1 betwen numbers from a key:1# text file. How to copy text content1 content2 in rows betwen NAME#23. How to copy text in rows NAME#1 betwen numbers from a key:1# text file. NAME#2
5. How to copy key:1# text in rows betwen numbers from a text file . How to copy text in rows betwen numbers from a text file NAME#1. How to copy text in rows betwen numbers from a text file How to copy text in rows betwen numbers from a text file How to copy text in rows betwen numbers from a text file 8090. How to copy text in rows betwen numbers from a text file NAME#25. How to copy key:1# text in rows betwen numbers from a text file . How to copy text in rows betwen numbers from a text file NAME#1. How to copy text in rows betwen numbers from a text file How to copy text in rows betwen numbers from a text file 8090. How to copy text in rows betwen numbers from a text file NAME#2
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
OK. And how far have you managed to get?
 
Upvote 0
That's a shame. Most people, when they come to this forum asking for help/guidance, will usually at least throw in a 'please' or a 'thank you' rather than simply listing out their requirements.
But don't worry - I'm sure someone bored and willing to do your bidding will come along to code it for you soon.
 
Upvote 0
What does it actually mean "how far have you managed to get?"
I thought it is about the excel results I tried to get by myself. So replied that way.
 
Upvote 0
It means "How far have you managed to progress in coming up with a coded solution?"
"None" would seem to indicate that you've done nothing in that regard.
 
Upvote 0

Forum statistics

Threads
1,214,976
Messages
6,122,543
Members
449,089
Latest member
davidcom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top