The code you've posted initializes the userform with contents drawn only from the second table in the document. So, if your command button is doing something different, it seems to me your command button code is where you should look.
A couple of points:
1. Having set oTbl via 'Set oTbl = oDoc.Tables(2)', the first set of loops ignores that and continues to reference oDoc.Tables(2);
2. Whereas the first loop efficiently uses a range object to retrieve the cell content, the second loop takes an entirely different, and less efficient, approach, retrieving then truncating the cell content. You could quite easily have re-used the previous range object (and even the row/column indices rather than using a completely new set).
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
|