Hi ODeveloper and welcome to ExcelForum,
I made a few behind the scenes changes to your Userform:
a. Changed Control Names
b. Initialized the 'CommandButton' to 'Not Visible'
c. Changed 'ComboBox' attributes to 'Match First Letter' and 'Match Required'.
d. Changed 'Tab Order' so the 'Name' TextBox would have initial focus.
Try the attached file which implements the following code.
UserForm code:
Ordinary Module Code such as Module1 to ModExcelToWord:
It is a best practice to declare all variables. If you misspell a variable in your code, VBA will silently assume it is a Variant variable and go on executing with no clue to you that you have a bug. Go to the VBA development window, click Tools, Options, and check "Require Variable Declaration." This will insert the following line at the top of all new modules:
This option requires all variables to be declared and will give a compiler error for undeclared variables.
Lewis
Bookmarks