#1
|
|||
|
|||
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
|
||||
|
||||
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
|
||||
|
||||
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
|
|||
|
|||
Thanks for the answer. Is not work
Last edited by kazec; 06-11-2019 at 11:58 AM. |
#5
|
||||
|
||||
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
|
|||
|
|||
Here are the 'before' and required 'after' screenshots. I have now deleted my attachment.
Last edited by kazec; 06-11-2019 at 11:57 AM. |
#7
|
||||
|
||||
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
|
||||
|
||||
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] |
Tags |
vba code, word 16 |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to resize a paragraph range to include just a single line of text | Peterson | Word VBA | 5 | 07-08-2019 04:36 PM |
Pasted text becomes single long line | qaz1 | Word | 1 | 07-25-2015 04:13 AM |
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 |
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 |
Need help on Macro 03- Find text - if text is blank then remove line | simpleonline1234 | Word VBA | 1 | 02-25-2011 02:28 AM |