Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 05-05-2021, 09:32 PM
NameIsJustAnIllusion NameIsJustAnIllusion is offline Extracting text from Start and End position Windows 10 Extracting text from Start and End position Office 2019
Novice
Extracting text from Start and End position
 
Join Date: May 2021
Posts: 11
NameIsJustAnIllusion is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Simple - have your macro:
1. Mark all content as hidden.
2. Find the text you want to preserve and unhide it
3. Find and delete all hidden text.
Thanks Paul for your reply. I am not sure I understand. What I want is not to hide but discard the text completely. Finally I would be saving the document.

Quote:
Find the text you want to preserve
There is no fixed text as I mentioned in the question. It is more about start position or end position. I have these as numbers and not text. The text/character at the start position can be a "Space" or a "Full Stop".

For example, let's say I have this simple text

Quote:
The quick brown fox jumps over the lazy dog
And I want to keep only the text from 11th position till 31st position with the formatting and delete everything. If it was an unformatted string, I could have used

Code:
MyString = "The quick brown fox jumps over the lazy dog"
Debug.Print Mid(MyString, 11, 31 - 11)
This would give me the desired text "brown fox jumps over" but the formatting is lost.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Choose multiple start and end position of window in a row... Ganesh Kumar Excel 9 04-01-2019 08:26 AM
Help with Formula to extracting text from text string Haha88 Excel 7 01-13-2019 01:33 AM
Extracting text from Start and End position Help with Formula to extracting text from text string Haha88 Excel 9 02-05-2018 01:04 AM
Extracting text from Start and End position Start from the previous position Dimsok Word VBA 7 09-14-2014 06:07 AM
Justify Paragraph Start position with VBA jeff_kaufman Word VBA 2 11-09-2013 12:15 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:49 AM.


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