ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Cut and Paste Macro (https://www.excelbanter.com/excel-programming/282290-cut-paste-macro.html)

Price

Cut and Paste Macro
 
I am trying to create a Macro that cuts some preset text and pastes it
to the cell that I currently have selected. I created a button and
linked it to a macro with the following code:

Sub Macro1()
Range("A1:C1").Select
Range("C1").Activate
Selection.Copy
Range("A8").Select
ActiveSheet.Paste
End Sub

The problem is that it always copies the code to cell A8. I see
where like 5 does this, but I haven't been able to find the command
which always puts it in the currently selected cell.

Your help is appreciated.

Price

Felix[_3_]

Cut and Paste Macro
 
This will do. Select the target cell, press the button.

Sub Macro1()
Range("A1:C1").Copy
ActiveSheet.Paste
End Sub


-----Original Message-----
I am trying to create a Macro that cuts some preset text

and pastes it
to the cell that I currently have selected. I created a

button and
linked it to a macro with the following code:

Sub Macro1()
Range("A1:C1").Select
Range("C1").Activate
Selection.Copy
Range("A8").Select
ActiveSheet.Paste
End Sub

The problem is that it always copies the code to cell

A8. I see
where like 5 does this, but I haven't been able to find

the command
which always puts it in the currently selected cell.

Your help is appreciated.

Price
.



All times are GMT +1. The time now is 01:53 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com