Enter value from one userform to another

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,832
Office Version
  1. 2007
Platform
  1. Windows
Afternoon.
I would like to copy a value from one userform to another.
This is currently how it works.

I open a userform called HondaSheetForm & select a value from combobox2
I then run the code below via a command button.

Rich (BB code):
Private Sub CheckMyPartNumber_Click()
    If ComboBox2.ListIndex > -1 Then
        HondaParts.MyPartNumber.Value = ComboBox2.Value
        HondaParts.Show
    Else
        MsgBox "NO HONDA PART NUMBER WAS SELECTED", vbCritical, "HONDA PART NUMBER LOOK UP MESSAGE"
    End If
        ComboBox2.SetFocus
End Sub

The userform called HondaParts opens and i take note of the value in the TextBox called HondaPartNumber.
I then close this userform & go back to the first userform called HondaSheetForm.
The value i took note of is then selected from a drop down list in ComboBox3

So without having to remember the value i would like to have a code do it for me.
So when the second userform is open have the code copy the value & paste it into the combobox on the first form.
This ComboBox i suppose can then be changed to a TextBox as there will be no need to select anything from it
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

Forum statistics

Threads
1,224,826
Messages
6,181,192
Members
453,021
Latest member
pingpong7117

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