Thread: VBA copy issues
View Single Post
 
Old 05-05-2023, 01:15 AM
syl3786 syl3786 is offline Windows 10 Office 2019
Advanced Beginner
 
Join Date: Jan 2023
Posts: 78
syl3786 is on a distinguished road
Default

Quote:
Originally Posted by Guessed View Post
Oops, my bad. I didn't read beyond your code.

Your code is finding a string from the list. When it finds that string, it appears you want to report that value (which you already had anyway). It would make more sense if it actually looked to the right of the found string to return the value of the text sitting beside that found string (or returned the contents of the whole paragraph).

Neither of the Excel workbooks look like they match the concept of list.xlsx. I was expecting a list of user names in that. Your code then loops through each list item finding hits before moving on to a next list item. This will harvest the data in unrelated order - for instance your outcome doc shows an order like
CEO, Oliver, CEO, Ethan, CEO, Amelia, ...
but your code is structured to return
CEO, CEO, CEO, ..., Oliver, Ethan, Amelia, ...
Why would that be a useful output?

I'm looking at the contents of the Word file and in my mind, aligning it with your outcome workbook and think perhaps the list and the search is a pointless distraction. To me it appears you want the dialog transferred in the correct order into Excel and separate the speaker from the dialog by putting each into two separate columns. If this is the case, what is the point of searching for list items unless you want to exclude specific speakers?

Your word doc shows xxx against each name. Your Excel workbook shows headings of Name & URL. Is each piece of text beside a name a URL or a string of text?
May I ask if you could help edit the codes? I am still new to VBA. I beg you on bended knee on that. Please
Reply With Quote