Prev: Web Query
Next: Prevent copy and paste in one column
From: EGL on 30 Apr 2010 14:15 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? -- Thanks, --EGL
From: JLGWhiz on 30 Apr 2010 15:31 When the workbook deactivate event occurs, the control automatically loses focus. "EGL" <EGL(a)discussions.microsoft.com> wrote in message news:FA2F1EA5-C161-4046-BD53-438BF259A096(a)microsoft.com... >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? > > -- > Thanks, > > --EGL
|
Pages: 1 Prev: Web Query Next: Prevent copy and paste in one column |