Saving from form into multiple sheets

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
 
D

David Adamson

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
 
R

ryssa

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.
 
Top