LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Using Public to Pass Variable

I have a UserForm that captures the users name, I am trying to pass that
information to another UserForm. I'm assuming that is possible using the
Public declarations, but I am obviously having problems. Here is my example
code

Public Name As String
________________________________
Private Sub OKButton_Click()
Name = NameBox1

UserForm4.Hide
End Sub
________________________________

'Name gets passed to this UserForm

________________________________
Private Sub SignOffButton_Click()
MsgBox Name

Unload UserForm5
End Sub
________________________________

Do I need to declare the variables Public in UserForm5 also? Are they
declared in the right place? Should the subs be name Public instead of
Private? etc. My MsgBox is returning empty. Any help is greatly
appreciated.

DP

 
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
Public variable Jack New Users to Excel 4 March 18th 06 09:35 PM
Public variable usage! pikus Excel Programming 0 April 13th 04 09:28 PM
Public Variable Jason Excel Programming 4 April 12th 04 07:06 PM
Public/Procedure Variable Otto Moehrbach[_6_] Excel Programming 2 February 6th 04 04:58 PM
public variable marwan hefnawy Excel Programming 1 September 5th 03 08:54 AM


All times are GMT +1. The time now is 12:59 AM.

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"