Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default vba for excel

How can I make subs in Userform modules be available in
standard modules?

I think it might have something to do with declaration,
but I have problems doing it.

Thanks for helping.

Yehuda
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default vba for excel

You need to put the subs in general modules and call them from the userform
module if you need to do this.

--
Regards,
Tom Ogilvy

"Yehuda" wrote in message
...
How can I make subs in Userform modules be available in
standard modules?

I think it might have something to do with declaration,
but I have problems doing it.

Thanks for helping.

Yehuda



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default vba for excel

Access it with normal class notation.

Userform1.Subname

make sure nothing is private.

Keith
www.kjtfs.com


-----Original Message-----
How can I make subs in Userform modules be available in
standard modules?

I think it might have something to do with declaration,
but I have problems doing it.

Thanks for helping.

Yehuda
.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default vba for excel

To do this 'cleanly' not only should the procedure be
public, but the userform ought to be loaded into memory

Sub test()
Dim temp As UserForm1
Set temp = New UserForm1
Load temp
temp.helloworld

Unload temp
Set temp = Nothing
End Sub

Calling the procwill by default force open the userform

In general, place important subs in a standard module,
make sure that they're public , then you code in other
modules etc will be able to use them.
If you don't wanta public sub available to the macro list
on the workbook, then mark the module as

Option Private Module

Patrick Molloy
Microsoft Excel MVP


-----Original Message-----
Access it with normal class notation.

Userform1.Subname

make sure nothing is private.

Keith
www.kjtfs.com


-----Original Message-----
How can I make subs in Userform modules be available in
standard modules?

I think it might have something to do with declaration,
but I have problems doing it.

Thanks for helping.

Yehuda
.

.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:43 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"