Currently, I have 3 worksheets: DataEntry1, Autofillform2, Database
I am using a VBA script (provided by Roy) to autopopulate text from DataEntry to Database. One row for each record.
Now I need to amend the code so that when you click on "Save Record" some text is also autopopulated to the worksheet "Autofillform2"
The fields I need autopopulated are in yellow.
Can anyone amend the exisiting code? you don't need to add code for all the fields but just put etc.. so I get the idea of how the code is working.
Also is it possible to check for duplicate entries? field "Unique Identifier".
Code is below and spreadsheet is attached.
Thanks,
Dave32
![]()
Private Sub CommandButton1_Click() Dim R As Long With Sheet2 R = .Cells(.Rows.Count, 1).End(xlUp).Row + 1 .Cells(R, 1).Value = Sheet1.Cells(3, 2).Value 'ID .Cells(R, 2).Value = Sheet1.Cells(4, 2).Value 'Campaign Name .Cells(R, 3).Value = Sheet1.Cells(5, 2).Value 'Region .Cells(R, 4).Value = Sheet1.Cells(6, 2).Value 'Country .Cells(R, 5).Value = Sheet1.Cells(7, 2).Value 'Product Focus 'etc End With End Sub Private Sub CommandButton2_Click() Range("B3:B13,B17:B28,D5:D7").ClearContents End Sub











LinkBack URL
About LinkBacks
Register To Reply

Bookmarks