PDA

View Full Version : Call a Private Sub from another userform



Coolmo
2008-03-04, 03:31 PM
How can I use a user defined Private sub from another userform? I want to be able to click on a button from one userform and have it go to another userform's private sub to calculate something for me and then return to the original userform. I'm sure this is very easy. Do you do this in a module?

Ed Jobe
2008-03-04, 04:05 PM
As long as you've got it declared as private, the form would have to initiate the call. Either make the procedure public or create another public sub that can call it. Whether the calling code is in a regular module or another form's class module makes no difference as to the scope of the source procedure.