Saving from form into multiple sheets

  • Thread starter Thread starter ryssa
  • Start date Start date
R

ryssa

I have built a form to enter data from. I have two sheets, “Customers
and “Projects”.
Some fields are duplicated in both sheets.

How do I activate both sheets?
How do I make Customer data be saved into "Customers" sheet an
Projects data be saved into "Projects" sheet?
How do I ensure that the data of the duplicated fields are saved int
both sheets?

Thank you very much
 
Just change the range to where you want the data to go on the appropriate
sheet


Worksheets("Customers").range("a3") = control(whatever you are calling the
thing you enter datainto)
Worksheets("Projects"),rang("b3")=control(whatever you are calling the thing
you enter datainto)

If you are dealing with a lot of data then you are better setting up a loop
to paste the data back into the spreadsheets
 
Thank you David, though I am not a programmer and Im not sure what to do
with that. Here is what my code looks like.

Private Sub cmdSave_Click()

ActiveWorkbook.Sheets("Contacts").Activate
Range("A1").Select

Do

If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If

Loop Until IsEmpty(ActiveCell) = True

ActiveCell.Value = txtName.Value
ActiveCell.Offset(0, 2) = txtCompany.Value
ActiveCell.Offset(0, 3) = txtAddress.Value
ActiveCell.Offset(0, 4) = txtPhone.Value

ActiveCell.Offset(0, 13) = txtProject.Value
ActiveCell.Offset(0, 10) = cboIndustry.Value
ActiveCell.Offset(0, 15) = cboPersonInCharge.Value

End Sub

In "Customers" sheet I am supposed to save the data
Name, Company, Address, Phone

In "Projects" sheet I am supposed to save the data
Project, Company, Name,
Industry, Person In Charge

Though in reality I have many more that just those fields.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top