andy_uk
08-09-2004, 05:14 PM
Not a question, just sharing an experience. It'll highlight the extent to which I'm struggling with the whole "object" concept, at the same time if someone searches for the same thing it might help, so what the hey(?)
So I had a UserForm with a text box and a command button on. But I wanted to store the actual button code in a separate module, for the sake of organisation (my UserForm mod is 3 feet long already!).
So I had something like
Private Sub CommandButton1_Click()
Macro1
End Sub
Macro1 said something like
Range("Sheet1!A1") = TextBox1
It took me about 10 minutes to figure that I had to say
Range("Sheet1!A1") = UserForm1.TextBox1
I guess the irony is that I covered the object concept for the worksheet (Sheet1!A1), then completely overlooked it for the form. :blush
HTH someone, sometime.
Rgds,
Andy
So I had a UserForm with a text box and a command button on. But I wanted to store the actual button code in a separate module, for the sake of organisation (my UserForm mod is 3 feet long already!).
So I had something like
Private Sub CommandButton1_Click()
Macro1
End Sub
Macro1 said something like
Range("Sheet1!A1") = TextBox1
It took me about 10 minutes to figure that I had to say
Range("Sheet1!A1") = UserForm1.TextBox1
I guess the irony is that I covered the object concept for the worksheet (Sheet1!A1), then completely overlooked it for the form. :blush
HTH someone, sometime.
Rgds,
Andy