If you know portions of code that may help in any facet it would be very helpful.

I need to extract cells in an Excel document if they meet a criteria and have them pulled into a word document to create sentences.

Right now I have a word document, and an excel document open. The VBA is operating from Word. So far I have the word document VBA asking the preliminary information needed for the upcoming paragraph to be coherent.

The excel document has columns 5 listed that I need to extract data going downward.

I am having trouble finding a code that opens an already existing, and active, excel document.

After activating the excel document, i need to select from the 5 columns in an If Then statement until there is no data left. Example:

IF
1,2,3,4,5
1,2,3,4,5
1,2,3,4,5
1,2,3,4,5 END IF

Some of the cells may be missing numbers, and can be skipped

If
1,2,3,4,5
1,2,3
1,2,3
3,4,5
3,4,5
END IF

I need to extract these cells in an order, which will create sentences. The order will not change, but the selected data incoming will change.

IF
1,2,3,4,5
1,2,3
1,2,3
3,4,5
4,5,1
2,3,4

End If


A sentence would look like 1 2 3 4 5, or 1 2 3, or 3 4 5. Etc.

I know how to format the sentences, add commas/breaks, etc. I just don't know how to extract from Excel in an If Then loop without crashing my computer. Also, bonus points if you can find a code for me that doesn't need to be edited, as in find document on C://Here/Here/Here.doc. I would love to just have it use whatever excel document is open during the time it is run in Microsoft word.

Thanks!