Copy but paste in different cells. Please help - Thanks

pedie

Well-known Member
Joined
Apr 28, 2010
Messages
3,875
Hi,
What 'm trying to achieve here is for the code to select the first 3cells only (row) not the whole xltoright.
how can i make the code to copy the 1st 3 cells in the row and then select A1 and paste the 1st value
2nd value in A5 and 3rd copied value to A6?

Thanks for helping

Code:
Sub Macro1()
Sheet1.Select
ActiveCell.Select
    Range(Selection, Selection.End(xlToRight)).Copy
    Range("A1").Select
    ActiveSheet.Paste
    Application.CutCopyMode = False
End Sub
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Hi Pedie,
How about something like this?
Code:
Sub Macro1()
Sheet1.Select
With Cells(ActiveCell.Row, "A")
    .Copy Range("A1")
    .Offset(, 1).Copy Range("A5")
    .Offset(, 2).Copy Range("A6")
End With
End Sub

(Oh yeah, do you really need to select sheet1?)

Does that help?
 
Upvote 0
Hi pedie

Do you mean this?
Excel Workbook
ABC
1123
2
3
41
52
63
Sheet1
Excel 2007<font face=Courier New><SPAN style="color:#00007F">Sub</SPAN> test()<br>  <SPAN style="color:#00007F">With</SPAN> Sheet1<br>    .Range("A1").Resize(, 3).Copy<br>    .Range("A4").PasteSpecial Paste:=xlPasteAll, Transpose:=<SPAN style="color:#00007F">True</SPAN><br>  <SPAN style="color:#00007F">End</SPAN><SPAN style="color:#00007F">With</SPAN><br>  Application.CutCopyMode =<SPAN style="color:#00007F">False</SPAN><br><SPAN style="color:#00007F">End</SPAN><SPAN style="color:#00007F">Sub</SPAN><br></FONT>
 
Last edited:
Upvote 0
Hi Dan, Hi Brian..!
Sorry, got some work so could reply back soon. I'm not sure if I am doing it wrong or 'm explaining
it differently.
ActiveCell.Resize(, 3).Copy is good enough but i dont want them to be pasted in serial altogether
from the copide value, I want the first value to be on A1, and the other two to be in A5 and A6.
Thanks again!
Pedie
 
Upvote 0
Dan, your code seems to do something but i'm new to those so dont know what is going on..lol
I select f3, and run the code...what i expect is that it will copy f3,4 & f5 and paste it in a1 (the 1st copied value, nd in A5 and 3rd in A6),
But it just pasted in A5 only
 
Upvote 0
Does this do it

Code:
Sub macro1()
Sheet1.Select
With ActiveCell
    .Copy Destination:=Range("A1")
    .Offset(, 1).Copy Destination:=Range("A5")
    .Offset(, 2).Copy Destination:=Range("A6")
End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

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