copy from one userform to another

kingcc

New Member
Joined
Oct 9, 2017
Messages
11
I have a workbook that have 2 userforms userform12 and userform 15
but the second userform15 open when i click in a textbox txt17 in userform12

Private Sub txt17_Enter()
Me.cmbslno.Copy
Unload Me
UserForm15.Show
End Sub
in userform12 there is a textbox that is actually a dropbox "cmbslno" that takes values from wsheet "stoixeia" column A
when i click at txt17 usually in cmbslno there is a values from 1 to 17
i want to do that that value to be paste in userform15 to dropbox cmbslno2
i thought to be copied before unload so to be paste in userform17 just like me.cmbslno2.paste but not works
i tried to make an attachment but failed
hope to be understood
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
but the second userform15 open when i click in a textbox txt17 in userform12
That's because you use Enter.
Also,
VBA Code:
Private Sub txt17_Enter()
Me.cmbslno.Copy
Unload Me
UserForm15.Show
End Sub
You can't use the copy method this way.
Prepare a command button on UserForm12 instead and try the codes below.
VBA Code:
Private Sub CommandButton1_Click() 'Code for UserForm12
    Me.Hide
    UserForm15.Show
End Sub
VBA Code:
Private Sub UserForm_Initialize() 'Code for UserForm15
    cmbslno2.Value = UserForm12.cmbslno.Value
    Unload UserForm12
End Sub
You might have to change the names of userform objects in these codes because I don't quite understand:
in userform12 there is a textbox that is actually a dropbox "cmbslno" that takes values from wsheet "stoixeia" column A
when i click at txt17 usually in cmbslno there is a values from 1 to 17
i want to do that that value to be paste in userform15 to dropbox cmbslno2
 
Upvote 0
Solution
@kingcc

Please note:

Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at: copy from one userform to another | Chandoo.org Excel Forums - Become Awesome in Excel
If you have posted the question at more places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,818
Members
449,049
Latest member
cybersurfer5000

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top