copying to other worksheets

roadshow1uk

New Member
Joined
Jan 3, 2005
Messages
32
Hi guys

Can any of you kind souls help me by providing some commented code that will allow me to copy the first five cells of a row in sheet 1 into the next available blank row of another sheet 2(all complaints) in the same workbook. I need to use buttons to copy the data depending on an outcome of a review. Eg if a complaint is upheld click upheld and this copies the row to the upheld worksheet then deletes the entry in all complaints. the same then for not upheld complaints.

thanks for any help

Kev
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Does the row that you would like to copy have the active cell? Are you sorting these from a master worksheet to other worksheets? If you don't have an answer by tomorrow I will try to get back with you on this. Don't know if I can help but I will give it a shot.
 
Upvote 0
Don't know if this is the best way to do this but it works. You can assign this vba code to your button. Just replace the Sheet Names with your sheet Names. If it is not what you were looking for let me know. Hope this helps.

Sub Upheld()
' Cell Select
' Upheld Macro Button
' Uses first 4 cells including active cell. Active cell must be in column A


Range(ActiveCell, Cells(ActiveCell.Row + 0 - 0, ActiveCell.Column + 4 - 0)).Copy
Sheets("Sheet2").Select
Range("A1").Select
NextRow = Application.CountA(Range("A:A")) + 1
Cells(NextRow, 1).Activate
ActiveSheet.Paste
Sheets("Sheet1").Select
Range(ActiveCell, Cells(ActiveCell.Row + 0 - 0, ActiveCell.Column + 4 - 0)).Delete Shift:=xlUp
End Sub


Sub Upheld()
' Row Select
' Upheld Macro Button
' Uses Entire Row so active cell can be in any location of Row


ActiveCell.EntireRow.Copy
Sheets("Sheet2").Select
Range("A1").Select
NextRow = Application.CountA(Range("A:A")) + 1
Cells(NextRow, 1).Activate
ActiveSheet.Paste
Sheets("Sheet1").Select
ActiveCell.EntireRow.Delete


End Sub
 
Upvote 0
Does the row that you would like to copy have the active cell? Are you sorting these from a master worksheet to other worksheets? If you don't have an answer by tomorrow I will try to get back with you on this. Don't know if I can help but I will give it a shot.
Hi sory for the late reply, been away from work.
Esentially a single sheet will contain a list of all complaints received to a given team, A complaints manager will review the complaint in this master complaints sheet then decide if the complaint is upheld or not upheld. I wanted there to be two buttons at the end of the row one upheld and the other not upheld. the actions of these will be to move the details to specific sheets. Not sure what you mean when you ask about the active cell can you elaborate. I will test this over this week and come back to you. Huge thanks for your support with this,
 
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,828
Members
452,946
Latest member
JoseDavid

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