Which textbox am I in?

E

EGL

I have a single worksheet workbook with several individual textboxes (not
part of a form). Upon deactivation of the workbook (i.e. switching to
another woorkbook) I want the workbook deactivate procedure to loop through
all of the textboxes and determine if the user is "in" one of them. If the
user is in a textbox, I want the deactivate workbook procedure to call the
Lost Focus routine for the particlar textbox before proceding to the new
workbook that was selected.

When looping through the textboxes, how do I construct an "if" statement in
VBA that asks "if the user is in textbox1 then...". MSForms has an
AciveControl member within its Page class, but I can't find an equivalent in
the Excel or VBA libraries. ANy suggestions or insight?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top