I have a workbook that I'm trying to create comment boxes automatically for the cells in column A. There is an associated text file that holds all the verbage for the comments and each comment has a heading that easily relates to the cell in column A. For example, if cell in column A said "A. First Order" then the text file would have:
A. First Order
1. The first order of business..,
where the comment falls on the line or lines after the heading. This is the code that I have so far to try and do this:
I just have messageboxes now so I can track the progress of the code, but I'll add the actual format/add commentbox code later.
My issue is I either get infinite loops or a loop that correctly identifies commentbox text the first time only and no time after that.
The idea is to look at the line read from the file and compare it to the text in column A. If its a match, it starts reading in the next line(s) from the file until it gets to a line that matches (contains) text from the next cell down in Column A. This is the main problem because I have to read in the line before I compare it and with the code I have now, when I restart the loop I read in the next line of the file, which will never match anything in column A, because its a comment line.
I want to automate this process because a) its a long file b)its the first revision which means adds/removals and verbage changes later c)I have to do it to two sheets in the workbook. I've attached a snippet of the xls and txt files.
I'm open to any suggestions (case statements, complete re-code, etc) because I've only been using VBA about a week so its all pretty new. Thanks for your help.
Bookmarks