Sorry, I think the problem is that I'm using VBA and I'm coding a macro in Excel. I tried the code you suggested, but the compiler doesn't recognize the property "txt.OnChange"; otherwise, it would be a very good solution to my problem.
I have to say, I'm a little surprised at this ...
Thanks for the input...
My problem is that the txt.OnChange property isn't recognized that way. The only way I know of to define an event for a given control is
Sub ControlName_Change()
'code
End Sub
I have created a dynamic array of controls by creating an array of objects and then...
I'm trying to create an array of controls on a userform which are created at runtime, which I can then reference using an index number to define events.
My problem is that I'm declaring a dynamic array of controls using:
Dim textbox() As Object
and then in the Initialization event for the...
Thanks Zemp. Just one more question:
The way I've done it, I declare the dynamic array of Textbox controls as objects:
Dim textbox() As Object
and then add a new textbox control in the Initialization event with:
Set textbox(c) = userform.Controls.Add("Forms.Textbox.1")
so I can...
Thanks for all the help so far. . . maybe I just don't get it. . .
I am able to create the array of controls, which are TextBoxes, at runtime. I need them to be dynamically created at runtime because the number of them is dependent on a variable integer.
I can change properties for these...
Thanks, Rick, sounds good if I can do it.
What is the syntax for creating an array of events? And once I have the event array, how can I write a For loop that will work when a particular one fires (given that there will be a variable number of them?
Thanks again, Max
I'm trying to construct a userform that has fields which, when filled, form an equation. Each field is a separate part of the equation and the number of parts is variable, thus I've had to write code creating the necessary number of controls for any given equation. This I've written at the...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.