View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Andrew[_49_] Andrew[_49_] is offline
external usenet poster
 
Posts: 4
Default Calling sub routines

I have a userform with a sub-routine "under" it that I want to call from a routine under another userform within the same project. I changed the called routine title from Sub to Public Sub having read some of the previous posts on a similar topic but I seem to be missing the plot somewhere.

UserForm1
Private Sub cmdPrint_Click()
Call Print_Report

Public Sub Print_Report()

...... this works


UserForm2
Private Sub cmdPrint_Click()
Call Print_Report

...... this doesn't work

I cant put the Print_Report() routine in the Modules section because it pulls values from the forms. I guess there is a way to get over that problem as well but I thought the first fix would be the easiest to discuss.

Thanks for your help in advance.
Andrew