Using Selection.Copy to transfer data to another sheet, starting from column C

dimsums

New Member
Joined
Jun 29, 2020
Messages
30
Office Version
  1. 365
Platform
  1. Windows
Hi all,
This might be a silly question but i am new at VBA so can't seem to figure out what the error in my code it.
I have two sheets, sht1 and sht2, from which a user is to highlight the row to transfer sht2 from the next empty row and starting from column C. My code is as follows

Sub NewMove()
Dim sht1 As Worksheet
Dim sht2 As Worksheet

Set sht1 = Sheets("Sheet1")
Set sht2 = Sheets("Sheet2")

Selection.EntireRow.Select
Selection.Copy

sht2.Cells(Rows.Count, 3).End(xlUp).Offset(1, 1).PasteSpecial xlPasteValues

End Sub

Could someone please help me figure out where i am going wrong. Thank you
 

dimsums

New Member
Joined
Jun 29, 2020
Messages
30
Office Version
  1. 365
Platform
  1. Windows
I tried it now. It works!
Thanks once again Fluff.
 

Some videos you may like

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
48,407
Office Version
  1. 365
Platform
  1. Windows
You're welcome & thanks for the feedback.
 

Watch MrExcel Video

Forum statistics

Threads
1,114,476
Messages
5,548,259
Members
410,825
Latest member
Dave12
Top