![]() |
Referencing a UserForm in a Module
I want to setup a module that will interact with UserForm1. During UserForm
Initialization I want to call the Missing Data routine and have if check the values of Optionbuttons 2212 and 2213 (on UserForm1) and if they are False then change the BackColor and BorderColor of Frame 2202, which is also on UserForm1. I know I can do this by placing the code within the UserForm but there are over 3000 lines of code for this UserForm and I am hoping that by moving some of this off to individual modules I can make my coded more manageable. Sub MissingData() ' ' ' ' With UserForm1 'Current No Show Data Check 'No Show 1 Data Check If OptionButton2212.Value = False Then If OptionButton2212.Value = False Then Frame2202.BackColor = &H80FFFF Frame2202.BorderColor = &HFF& End If End If End With End Sub |
Referencing a UserForm in a Module
Hi Patrick, You should just have to preface teh control refernce witha refernce to the userform. Using your sample code, something like this should work: If Userform1.OptionButton2212.Value = False Then |
Referencing a UserForm in a Module
Wow that was easy, Thanks.
"arjen van der wal" wrote in message ... Hi Patrick, You should just have to preface teh control refernce witha refernce to the userform. Using your sample code, something like this should work: If Userform1.OptionButton2212.Value = False Then |
All times are GMT +1. The time now is 04:44 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com