Passing Values from Userform (Or - What's a better way to do this?)

WrldIntlR

New Member
Joined
Jul 30, 2011
Messages
41
Ok so here's the situation.

I have a userform that's used for tracking data in real time. I need to be able to save the data to the user's local drive, but also save a copy to a public network drive for their supervisor so their supervisor can check into it at any time. Now, in the macro I create a new workbook, and all of the user data is saved to the new workbook, leaving my VBA-ridden workbook clean and untouched.

The save issue I'm not having a problem with. What I need to do is be able to ask for the supervisor seperately (in a different userform) from a CB. I have the sup userform programmed already with a drop-down CB. What I'm having trouble with is passing the value that's chosen in THAT userform to the main data-input form.

The reason I need this information is because on the network drive, I need to be able to sort out the saved data per supervisor, so I don't have a signal drive filled with hunderds of XLS (even if they are sorted by NT IDs). Essentially what I want to do is use the string in the Supervisor CB to select which subdirectory the results .xls will save in, which is why I need to access that string from the main userform.

Any help would be greatly appreciated!!!
 
Last edited:

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
What I'm having trouble with is passing the value that's chosen in THAT userform to the main data-input form.

OK, not being sure of your details, here's an example of what I think you're looking to do.

First, I have 2 userforms, one named "MainDataInputUserform" and the other named "SupervisorUserform".
On MainDataInputUserform I have a label, (named "Label1").
On SupervisorUserform I have a combobox named "SupNamesComboBox".

Then, I used the SupNamesComboBox_Change event to bring the chosen supervisor into the label in MainDataInputUserform like so:
Code:
Private Sub SupNamesComboBox_Change()
MainDataInputUserform.Label1.Caption = Me.SupNamesComboBox.Value
End Sub

Does that help at all?
 
Upvote 0
OK, not being sure of your details, here's an example of what I think you're looking to do.

First, I have 2 userforms, one named "MainDataInputUserform" and the other named "SupervisorUserform".
On MainDataInputUserform I have a label, (named "Label1").
On SupervisorUserform I have a combobox named "SupNamesComboBox".

Then, I used the SupNamesComboBox_Change event to bring the chosen supervisor into the label in MainDataInputUserform like so:
Code:
Private Sub SupNamesComboBox_Change()
MainDataInputUserform.Label1.Caption = Me.SupNamesComboBox.Value
End Sub

Does that help at all?

it does, yes thank you!
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,285
Members
452,902
Latest member
Knuddeluff

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