Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-15-2025, 01:09 AM
lalafresh lalafresh is offline I need to automate the merging of an unspecified number of rows located between asterisks Windows 11 I need to automate the merging of an unspecified number of rows located between asterisks Office 2021
Novice
I need to automate the merging of an unspecified number of rows located between asterisks
 
Join Date: Jan 2025
Posts: 8
lalafresh is on a distinguished road
Question I need to automate the merging of an unspecified number of rows located between asterisks

This is very difficult to explain so I will try to demonstrate with screenshots. I just learned how to use macros and find/replace with wildcards about 3 hours ago through google searches, so if anyone mercifully attempts to help me, please speak to me like I'm 5 years old because I have no idea what I'm doing.



I am copying/pasting a schedule from a website into a Word document each day. I have managed to use macros and find/replace to remove a lot of the information I don't need and reformat the rest in a way that makes it easier for me to use. I end up with a plain text document that looks like this (but much longer):

1.png

As you can tell, it's a list of people and their demographic/contact information and other things. The amount of information varies from person to person.

I then use the macro/find-and-replace to add asterisks between each chunk of text, effectively separating each person in the list and their information from the person above and below. Now I am working on automating the action of converting the text to a table with 1 column and as many rows as there are total lines of text, so that I will end up with each line of text in its own row, and a "separator" row containing an asterisk between each person, like this:

2.png

Now.... HERE is where I need help. I am trying to figure out how to automate the merging of the chunk of rows between each asterisk, so the end result will look like this:

3.png

The problem is the number of lines in each group could be 4 or it could be 10. It changes from person to person throughout the document, and from one day to the next.

It doesn't actually matter for my overall purposes whether or not these rows are merged-- I'm trying to do it only because it seems like the easiest way to accomplish what I'm ultimately after, which is a 2nd column on the right side with a blank space that spans the length of each chunk, like so:

4.png

I tried making a 2-column table and just merging the relevant rows in the 2nd column, but it seems like it would be much harder to automate this with a macro. If I can make a 1-column table with every line as a separate row, and with every group separated from each other by something (an asterisk in this case), and I can merge the relevant rows, then I can just do "insert column to the right" and it gives me the blank boxes I'm shooting for.

Any help that anyone can offer would be very much appreciated.

Thank you for reading!
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
I need to automate the merging of an unspecified number of rows located between asterisks Automate Row-wise and Column-wise Merging of Table Cells macropod Word Tables 0 11-15-2024 03:14 PM
Automate the filling in of the rows of a table Muzan93 Word VBA 4 05-19-2021 10:55 PM
I need to automate the merging of an unspecified number of rows located between asterisks Removing rows when mail merging Richystab Mail Merge 3 12-07-2020 03:05 AM
I need to automate the merging of an unspecified number of rows located between asterisks Merging Rows - HELP please! MessyJessy Excel 7 01-14-2015 01:38 AM
I need to automate the merging of an unspecified number of rows located between asterisks merging rows and creating sub-rows gib65 Excel 2 12-09-2011 02:09 PM

Other Forums: Access Forums

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