Copy Paste Delete Macro ?

sqex

New Member
Joined
Nov 22, 2005
Messages
19
HI Guys.

Im look for a way that when a button is clicked withing excel it will copy all data from certain cells to another sheet.

eg


A1 A2 A3

Data 1 Date Button - that copies


Sheet 2


A1 A2 A3

Data 1 copy Date copy Completed


I then need it to delete the orginal entry and just leave the word completed

IF anyone could help me out on this one i would be very very greatfull

Regards

sqex
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

HalfAce

MrExcel MVP
Joined
Apr 6, 2003
Messages
9,456
Hello sqex,
I'm not sure if this is what you're after, but perhaps it'll help get you started.
Code:
Sub Demo()
With Sheets("Sheet2")
    .[A1] = Sheets("Sheet1").[A1].Value & " Copy"
    .[A2] = Sheets("Sheet1").[A2].Value & " Copy"
    .[A3] = "Completed"
End With
With Sheets("Sheet1")
    .[A1] = "Completed"
    .[A2:A3].ClearContents
End With
End Sub
Hope it helps. Let us know if it doesn't.
 

sqex

New Member
Joined
Nov 22, 2005
Messages
19
Hi, not quite.

i need e.g

e11 , e12 , e13 to be copied to other cells on sheet 2 e.g e11 , e12, e13, when a button at the end of the row is pressed

the oringinal data is then deleted leaving only the new copied version.
 

HalfAce

MrExcel MVP
Joined
Apr 6, 2003
Messages
9,456

ADVERTISEMENT

You mean just this?
Code:
Sub Demo()
With Sheets("Sheet1").[E11:E13]
    .Copy Sheets("Sheet2").[E11]
    .ClearContents
End With
End Sub
 

sqex

New Member
Joined
Nov 22, 2005
Messages
19
Hi , thanks i tried to apply that to my sheet but just comes up with errors

As Simple as i can put it is this

Copy Data from e11 , e13 from "Monday"

Paste Data to e11 , e13 "Application History"

Delete Data from e11 , e13 on the "Monday" Sheet

Stop macro, assign macro to button. click button and the above works
 

HalfAce

MrExcel MVP
Joined
Apr 6, 2003
Messages
9,456

ADVERTISEMENT

Does that mean you're up and running now that you've recorded what you want to do?

It appears the reason you got errors (though you didn't mention what the errors were) with my code is because it's written to perform on sheets named "Sheet1" & "Sheet2"

If you want it to work on your sheets, you'd need to amend the code (and any other generic code examples you'll see) to specify your sheet names. (ie.)
Code:
 Sub Demo()
With Sheets("Monday").[E11:E13]
    .Copy Sheets("Application History").[E11]
    .ClearContents
End With
End Sub
Does that help at all?
 

sqex

New Member
Joined
Nov 22, 2005
Messages
19
when i use the code in that format, it just freezes up the application

i just cant seem to figure out why it wont take the data from the cells and paste it to another sheet without giving me erros the macro should work but just ends in an error and says debug Run time error 9 any help on this would be most greatful
 

HalfAce

MrExcel MVP
Joined
Apr 6, 2003
Messages
9,456
When you get the error and press Debug, which line of code is highlighted yellow?
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,019
Messages
5,834,984
Members
430,331
Latest member
Syed Yasir Hannan

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
Top