michelangelo
New Member
- Joined
- Nov 23, 2016
- Messages
- 6
I am trying to run a copy and paste code for a much larger marco that has a repeated copy and paste code. I get the 400 error with the lines of code idicated in bold (i have sepereately gone through lines checking!). Any and all help muhc appreicated!
Sub copy()
Dim TestRange As Range
Dim Pasterange As Range
Dim row As Integer
Dim newrow As Integer
Dim start As Integer
Dim finish As Integer
Dim sht As Worksheet
row = 1
start = 5
finish = 9
newrow = 2
Set sht = ThisWorkbook.Worksheets("Test")
sht.Select
ActiveSheet.Cells(row, start).Select
Set TestRange = Selection
Range("TestRange").Resize(1, 5).Select
ActiveSheet.Cells(newrow, start).Select
Set Pasterange = Selection
Range("TestRange").copy
Range("Pasterange").Paste
End Sub
Sub copy()
Dim TestRange As Range
Dim Pasterange As Range
Dim row As Integer
Dim newrow As Integer
Dim start As Integer
Dim finish As Integer
Dim sht As Worksheet
row = 1
start = 5
finish = 9
newrow = 2
Set sht = ThisWorkbook.Worksheets("Test")
sht.Select
ActiveSheet.Cells(row, start).Select
Set TestRange = Selection
Range("TestRange").Resize(1, 5).Select
ActiveSheet.Cells(newrow, start).Select
Set Pasterange = Selection
Range("TestRange").copy
Range("Pasterange").Paste
End Sub