Copying a row "1"

watsonla

New Member
Joined
Jul 3, 2011
Messages
23
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
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

Forum statistics

Threads
1,224,583
Messages
6,179,682
Members
452,937
Latest member
Bhg1984

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