ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Pass string value to another form (https://www.excelbanter.com/excel-programming/339723-pass-string-value-another-form.html)

yangyh[_5_]

Pass string value to another form
 

dear all,

I want to pass the string value (defined in Form1) to another For
(Form2). Can I use the following codes in Form1

Private Sub NextBotton_Click()
....
With UserForm2
...
String2 = String1
End With
End Sub

String2 is defined in Form2. Unfortunetly, String2 did not get th
value as expected. How can I pass the string values between tow forms
Thanks.

Davi

--
yangy
-----------------------------------------------------------------------
yangyh's Profile: http://www.excelforum.com/member.php...fo&userid=2688
View this thread: http://www.excelforum.com/showthread.php?threadid=46657


Norman Jones

Pass string value to another form
 
Hi David,

Declare sStr1 as global variable at the top of a standard module:

Option Explicit
Public sStr1 As String

The sStr1 variable's value can then be assigned in a UserForm1 routine and
this value will be available to Userform2


---
Regards,
Norman



"yangyh" wrote in
message ...

dear all,

I want to pass the string value (defined in Form1) to another Form
(Form2). Can I use the following codes in Form1

Private Sub NextBotton_Click()
...
With UserForm2
..
String2 = String1
End With
End Sub

String2 is defined in Form2. Unfortunetly, String2 did not get the
value as expected. How can I pass the string values between tow forms?
Thanks.

David


--
yangyh
------------------------------------------------------------------------
yangyh's Profile:
http://www.excelforum.com/member.php...o&userid=26883
View this thread: http://www.excelforum.com/showthread...hreadid=466574





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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com