LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default passing values from form to module

I'm thinking that if you're trying to read from a variable in a
userform class, you need to ref the class as you would any other class.

As Jim states, declaring a variable 'Public' in a userform keeps it
private to the userform because it dies when the userform is unloaded.
This is the same as what happens when a class terminates. Making the
declaration 'Public', though, does make the variable behave like a
property of the class and so should be handled as such.

You do it right by trying to access it before unloading the userform,
but because VB[A] doesn't know of it (unqualified ref) then you're SOL.
Try...

Range("A1").Value = LaunchForm.textvariable '//fully qualified ref

Alternatively, you could make the vars global by declaring them in a
standard module. This allows access to them from anywhere in your
project.

HTH

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


 
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing Form Values David Excel Programming 6 October 2nd 07 07:33 PM
Passing Module to subroutine SixSigmaGuy[_2_] Excel Programming 2 April 25th 06 10:59 PM
Passing arrays to VBA module Ralph K Excel Programming 1 November 20th 04 02:57 PM
Passing Strings from UserForm to Module John Kauffman Excel Programming 3 May 28th 04 05:01 PM
Passing variables from module to userform Chris Dunigan Excel Programming 4 November 26th 03 09:37 AM


All times are GMT +1. The time now is 03:12 PM.

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

About Us

"It's about Microsoft Excel"