Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Closed Thread
 
Thread Tools Display Modes
  #1  
Old 06-10-2019, 03:28 PM
kazec kazec is offline Find ... Windows 10 Find ... Office 2016
Banned
Find ...
 
Join Date: Jun 2019
Posts: 3
kazec is on a distinguished road
Default Find ...

Hello to all,

Maybe someone could help me. I've asked in other forums this question and I didn't get an answer.

I have a file that has some formatting that I want to beautify. It has some paragraph divided in parts by numbers. The numbers have a diferrent font than the text and the parts that belong to the same number appear sometimes in different line and I want to concatenate those texts in a unique line. For example:

1 Some text some text some
text some text. 2 Some text some text.

3 Some text some
text some text.
and I would like to have like this



1 Some text some text some text some text.
2 Some text some text.
3 Some text some text some text.
How can I do this with VBA?

Thanks

Last edited by macropod; 03-08-2022 at 09:21 PM. Reason: Restored original post
  #2  
Old 06-10-2019, 04:49 PM
macropod's Avatar
macropod macropod is offline Find ... Windows 7 64bit Find ... Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

You could achieve that with just two wildcard Find/Replace operations:
Find = [^13]{1,}
Replace = ^32
Find = ^32([0-9])
Replace = ^p\1
specifying your 8.5pt font as a Find parameter.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
  #3  
Old 06-10-2019, 05:20 PM
macropod's Avatar
macropod macropod is offline Find ... Windows 7 64bit Find ... Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

Cross-posted at: https://www.excelforum.com/word-form...same-size.html and https://stackoverflow.com/questions/...in-vba-wordFor
For cross-posting etiquette, please read: http://www.excelguru.ca/content.php?184
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
  #4  
Old 06-10-2019, 05:50 PM
kazec kazec is offline Find ... Windows 10 Find ... Office 2016
Banned
Find ...
 
Join Date: Jun 2019
Posts: 3
kazec is on a distinguished road
Default

Thanks for the answer. Is not work

Last edited by kazec; 06-11-2019 at 11:58 AM.
  #5  
Old 06-10-2019, 06:30 PM
macropod's Avatar
macropod macropod is offline Find ... Windows 7 64bit Find ... Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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 document is substantially different from what you described in your initial post. For starters, only the numbers are in 8.5pt - the rest of the content in the ranges concerned is at other point sizes, including the unwanted spaces immediately before the 8.5pt numbers. And I doubt you want your headings merged with the other lines.

In other words, your problem description has little to do with the reality of what it seems you want to achieve.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
  #6  
Old 06-10-2019, 06:41 PM
kazec kazec is offline Find ... Windows 10 Find ... Office 2016
Banned
Find ...
 
Join Date: Jun 2019
Posts: 3
kazec is on a distinguished road
Default

Here are the 'before' and required 'after' screenshots. I have now deleted my attachment.
Attached Images
File Type: png Demo.png (38.8 KB, 6 views)

Last edited by kazec; 06-11-2019 at 11:57 AM.
  #7  
Old 06-11-2019, 04:42 PM
macropod's Avatar
macropod macropod is offline Find ... Windows 7 64bit Find ... Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

Now also cross-posted at: How to concatenate specific text between specific style
Since you can't be bothered providing cross-post links and, moreover, you've stupidly attempted to vandalise this thread by deleting both the substance of your query and the associated document, don't expect help on any forum. Thread closed.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
  #8  
Old 06-25-2019, 05:58 AM
macropod's Avatar
macropod macropod is offline Find ... Windows 7 64bit Find ... Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

Cross-posted yet again at: vba - How to remove paragraph marks with different format in MS-Word - Stack Overflow
Account terminated.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Closed Thread

Tags
vba code, word 16



Similar Threads
Thread Thread Starter Forum Replies Last Post
Find ... How to resize a paragraph range to include just a single line of text Peterson Word VBA 5 07-08-2019 04:36 PM
Find ... Pasted text becomes single long line qaz1 Word 1 07-25-2015 04:13 AM
Find ... macro to add brackets to each line and add single quotes to each word in the line bracketandquotes Word VBA 17 02-16-2015 03:51 PM
Find ... How to create a table with a number of line depending a number entered by user Cellendhyll Word Tables 3 07-10-2014 05:49 AM
Find ... Need help on Macro 03- Find text - if text is blank then remove line simpleonline1234 Word VBA 1 02-25-2011 02:28 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:27 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