Help Copying a row "1" from A1:AT1 and pasting it to the bottom of a list of data (which can vary in size) to the first free row at the bottom of the list of data.
Once pasted to the bottom of the list of data, I then need to copy the row's data into outlook, by recognising the content of column b as "new"
I am currently using a form to enter the data, the button on the form runs a macro which pastes forms data into a spread sheet and it places data in sheet "copysheet" in row 1
Private Sub CommandButton1_Click()
Dim NewRow As Integer
NewRow = Worksheets("Copypage").Range("B3").Value + 1
Worksheets("copypage").Cells(NewRow, 2).Value = UserForm1.newuser.Value
Worksheets("copypage").Cells(NewRow, 4).Value = UserForm1.givenname.Value
Worksheets("copypage").Cells(NewRow, 5).Value = UserForm1.malefemale.Value
Worksheets("Copypage").Cells(NewRow, 6).Value = UserForm1.badge.Value
Worksheets("copypage").Cells(NewRow, 7).Value = UserForm1.dateofbirth.Value
Worksheets("copypage").Cells(NewRow, 8).Value = UserForm1.medicalnote.Value
Worksheets("copypage").Cells(NewRow, 11).Value = UserForm1.billingname.Value
Worksheets("copypage").Cells(NewRow, 16).Value = UserForm1.parentsname.Value
Worksheets("copypage").Cells(NewRow, 17).Value = UserForm1.homeno.Value
Worksheets("copypage").Cells(NewRow, 19).Value = UserForm1.cellno.Value
Worksheets("copypage").Cells(NewRow, 21).Value = UserForm1.emailaddress.Value
Worksheets("copypage").Cells(NewRow, 23).Value = UserForm1.housenameno.Value
Worksheets("copypage").Cells(NewRow, 24).Value = UserForm1.town.Value
Worksheets("copypage").Cells(NewRow, 25).Value = UserForm1.county.Value
Worksheets("copypage").Cells(NewRow, 26).Value = UserForm1.postcodeaddress.Value
UserForm1.Hide
Worksheets("newperson").Range("c2:c20").ClearContents
End Sub
I would like to use the same button from the form to sort data into the correct location and then add data to outlook.
Many thanks in advance for any help
watsonla
Once pasted to the bottom of the list of data, I then need to copy the row's data into outlook, by recognising the content of column b as "new"
I am currently using a form to enter the data, the button on the form runs a macro which pastes forms data into a spread sheet and it places data in sheet "copysheet" in row 1
Private Sub CommandButton1_Click()
Dim NewRow As Integer
NewRow = Worksheets("Copypage").Range("B3").Value + 1
Worksheets("copypage").Cells(NewRow, 2).Value = UserForm1.newuser.Value
Worksheets("copypage").Cells(NewRow, 4).Value = UserForm1.givenname.Value
Worksheets("copypage").Cells(NewRow, 5).Value = UserForm1.malefemale.Value
Worksheets("Copypage").Cells(NewRow, 6).Value = UserForm1.badge.Value
Worksheets("copypage").Cells(NewRow, 7).Value = UserForm1.dateofbirth.Value
Worksheets("copypage").Cells(NewRow, 8).Value = UserForm1.medicalnote.Value
Worksheets("copypage").Cells(NewRow, 11).Value = UserForm1.billingname.Value
Worksheets("copypage").Cells(NewRow, 16).Value = UserForm1.parentsname.Value
Worksheets("copypage").Cells(NewRow, 17).Value = UserForm1.homeno.Value
Worksheets("copypage").Cells(NewRow, 19).Value = UserForm1.cellno.Value
Worksheets("copypage").Cells(NewRow, 21).Value = UserForm1.emailaddress.Value
Worksheets("copypage").Cells(NewRow, 23).Value = UserForm1.housenameno.Value
Worksheets("copypage").Cells(NewRow, 24).Value = UserForm1.town.Value
Worksheets("copypage").Cells(NewRow, 25).Value = UserForm1.county.Value
Worksheets("copypage").Cells(NewRow, 26).Value = UserForm1.postcodeaddress.Value
UserForm1.Hide
Worksheets("newperson").Range("c2:c20").ClearContents
End Sub
I would like to use the same button from the form to sort data into the correct location and then add data to outlook.
Many thanks in advance for any help
watsonla