Is this VBA Possible (Userform Data to Multiple Sheets)

amoverton2

Board Regular
Joined
May 13, 2021
Messages
77
Office Version
  1. 2016
Platform
  1. Windows
Hi,

So I wanted to post this thread to see if it was possible first before taking the time to upload a fake workbook... I know how to add user form data to multiple sheets... I want to tweak it a bit though...

I have a multi-page user form, and on page 1 it has 10 text boxes with a command button off the page to add data.
The multi-page user form is 5 pages that all have different data going to 5 different sheets using only text boxes.

Here's the tweak
The first text box is for a last, first name, the other 9 are other data as are the other text boxes on each of the multi-pages. I want the first text box to go to the 5 sheets associated with the multipage user form and a random sixth page (this becomes a reference point for other functions such as searching, etc.) all while the other 9 boxes send their data to one of the other sheets, along with the other textboxes on pages of the multi-page. The last, first name cell is the next empty cell in column B of every sheet starting with B2 (row 1 is all headers on every sheet), this does not change.

Is this possible to do with one VBA or do I need separate ones?
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
One Vba script can do a lot of things.
Here is a example.
The script gets it information from different Textboxes no matter what page on the Multipage
Now these three textboxes were on three different Multipage Pages
VBA Code:
Private Sub CommandButton1_Click()
'Modified  9/30/2021  3:45:16 AM  EDT
Sheets(1).Cells(1, 1).Value = TextBox1.Value
Sheets(1).Cells(2, 1).Value = TextBox2.Value
Sheets(1).Cells(3, 1).Value = TextBox3.Value
End Sub
 
Upvote 0
So how do we go about my new challenge?
Well I think when your not use to using Vba you should go one step at a time.
Trying to mention 10 different things all at once can be a challenge.

And when you explain things you always have to be specific.
If you want your textbox value to go someplace you have to be specific.

Like: Sheets("Alpha").cells(1,1).Value=Textbox1.value
Now cells(1,1) is the same as saying Range("A1")

Like you said:
The first text box is for a last, first name, the other 9 are other data as are the other text boxes on each of the multi-pages. I want the first text box to go to the 5 sheets associated with the multipage user
Nothing here is specific
You have to give the exact sheet names and where on the sheet.
A script would look like this

Sheets("Alpha").Range("A1").value=Textbox1.value
Sheets("Bravo").Range("A1").value=Textbox2.value
And so on
You should see the ideal
 
Upvote 0
Not sure what this means:
I want the first text box to go to the 5 sheets associated with the multipage user form
Do you mean 5 worksheets

Glad to see your using Userforms and multipages
I suggest this to lot's of people who think the need 5 UserForms
 
Upvote 0
Okay, file: Meet Google Drive – One place for all your files

I want whatever is put in "txtPGNAME" (should be Last,First Name; JORDAN,MICHAEL) on the first multipage to go to every sheet (1-7) in the next empty cell in column B.

also, I misspoke earlier, there are 2 other sheets that "txtPGNAME" goes to besides the associated multipage sheets. And there are buttons on each page but I haven't updated that part yet to only have one command button for adding, which is what I want.
 
Upvote 0

Forum statistics

Threads
1,215,030
Messages
6,122,762
Members
449,095
Latest member
m_smith_solihull

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