ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Refer to control on userform from code module (https://www.excelbanter.com/excel-programming/396981-refer-control-userform-code-module.html)

Dale Fye

Refer to control on userform from code module
 
I have a code module that applies to several different controls on a form.

What I want to do is set a reference to the currently displayed form, then
refer to the ActiveControl on that form. How do you do this?

It's easy in Access, but I have not figured out the Excel Object model well
enough to know how to accomplish it in Excel.

Thanks, in advance.

--
Email address is not valid.
Please reply to newsgroup only.

Dale Fye

Refer to control on userform from code module
 
Disregard, figured it out.

Set ctrl = FormName.ActiveControl

--
Email address is not valid.
Please reply to newsgroup only.


"Dale Fye" wrote:

I have a code module that applies to several different controls on a form.

What I want to do is set a reference to the currently displayed form, then
refer to the ActiveControl on that form. How do you do this?

It's easy in Access, but I have not figured out the Excel Object model well
enough to know how to accomplish it in Excel.

Thanks, in advance.

--
Email address is not valid.
Please reply to newsgroup only.



All times are GMT +1. The time now is 05:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com