Copy and Paste based on userform selection

siarrad

New Member
Joined
Nov 20, 2018
Messages
4
Hello,

I was hoping that someone could help me edit the below code to do the following. The code I have copies the top row only.

Sub MoveCells()
Dim rng As Range
Application.ScreenUpdating= False
Dim copySheet AsWorksheet
Dim pasteSheet AsWorksheet
Set pasteSheet =Worksheets("Completed")
Set rng =Range("A1:J1")
rng.Copy
pasteSheet.Cells(Rows.Count,1).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues
Application.CutCopyMode= False
Application.ScreenUpdating= True
End Sub
My goal is to copy the data from a row on Sheet 1 and copy to sheet 3 based on the value that is in a Userform on sheet 2. So, on the userform, you select "complete" for a certain entry and the corresponding row from Sheet 1 moves to Sheet 2. Help please.
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
A Userform may be displayed on a Particular sheet but is not on a sheet.

So is Complete the name of a control on your userform?

So if you select 4 from your combobox named Complete you want to copy row 4 is that what you want?
 
Upvote 0
Thanks for responding My Answer is This. Please allow me to be more specific. As records are added to sheet 1, column A (the record name) is copied to the Userform as an available action. On the Userform (that is displayed on Sheet 2) if you select a record and then hit complete, the corresponding row on Sheet 1 should be cut and pasted to Sheet 3. For example, if there is a record on Sheet 1 "red" and I go to Sheet 2 and select "red" and hit complete, then the row that contained "red" should be cut and pasted to next available row on sheet 3.

Thanks again
 
Upvote 0
I do not understand any of this.
You said:
As records are added to sheet 1, column A (the record name) is copied to the Userform as an available action

Show me the script that does this.


Are you sure you know what a UserForm is?

You cannot copy a entire row to a Userform.
And you mentioned "red" several times.

Where is this "red"

 
Upvote 0
Sheet 1 has columns A-J. Sheet 2 has a table with information, Column A Sheet 2 = Column A Sheet 1, with a button that to the side that's called "Update table". When you hit the update table button, the userform pops up. On the userform, there is Column A (Column A Sheet 2= Column A Sheet 1 = Userform record) and then 4 options for updating the table. The last option is complete. So what I am trying to do is, when I select a record on the userform and then hit complete to update table, I also want the record from Sheet 1 (row) to cut and paste to Sheet 3(next available row).
 
Upvote 0

Forum statistics

Threads
1,215,022
Messages
6,122,726
Members
449,093
Latest member
Mnur

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