If you get a Variable Not Defined error, it means exactly that -- you
haven't declared the variable. At the beginning of the procedure, after the
Sub or Function statement, declare the variable:
Dim NextRow As Long

Signature
Cordially,
Chip Pearson
Microsoft MVP - Excel
www.cpearson.com
(email address is on the web site)
> Dear all,
>
[quoted text clipped - 19 lines]
> OptionUnknown = True
> TextName.Text.SetFocus
Freshman - 06 Nov 2006 06:56 GMT
Hi Chip,
Thanks for your help and it works. As I'm just a VBA beginner, please
tolerate my stupid question.
All the best. Regards.
> If you get a Variable Not Defined error, it means exactly that -- you
> haven't declared the variable. At the beginning of the procedure, after the
[quoted text clipped - 25 lines]
> > OptionUnknown = True
> > TextName.Text.SetFocus
Chip Pearson - 06 Nov 2006 17:54 GMT
We tolerate all kinds of questions -- we're a nice group of people. As an
aside, you posted your question in the worksheet.function newsgroup. It
would have been more appropriate to post in the programming group, since it
was a programming/VBA related question.

Signature
Cordially,
Chip Pearson
Microsoft MVP - Excel
www.cpearson.com
(email address is on the web site)
> Hi Chip,
>
[quoted text clipped - 35 lines]
>> > OptionUnknown = True
>> > TextName.Text.SetFocus