WBURKERT
Technical User
- May 28, 2010
- 73
Why do I get an error when trying to do the .paste but not when doing the copy? Just when I think I make progress with understanding I stumble. - This is just a piece of my macro, and think it should be enough for you to see the error in my ways.
Thanks in advace
For sRow = 1 To 3500
If Worksheets("PARTS").Cells(sRow, 5).Text = s And _
Worksheets("PARTS").Cells(sRow, 6).Text = "L" _
Then 'make worksheet ("Sec" & s) two columns
k = i - 1 'equals last row to move
b = (Round(k / 2)) + 1 'first row to cut and paste
i = 1 'equals starting position of second row
For d = b To k
With Worksheets("Sec" & s)
.Cells(d, 1).Copy
.Cells(i, 5).Paste
.Cells(d, 2).Cut
.Cells(i, 6).Paste
.Cells(d, 3).Cut
.Cells(i, 7).Paste
End With
i = i + 1
Next d
Else
End If
Next sRow
Thanks in advace
For sRow = 1 To 3500
If Worksheets("PARTS").Cells(sRow, 5).Text = s And _
Worksheets("PARTS").Cells(sRow, 6).Text = "L" _
Then 'make worksheet ("Sec" & s) two columns
k = i - 1 'equals last row to move
b = (Round(k / 2)) + 1 'first row to cut and paste
i = 1 'equals starting position of second row
For d = b To k
With Worksheets("Sec" & s)
.Cells(d, 1).Copy
.Cells(i, 5).Paste
.Cells(d, 2).Cut
.Cells(i, 6).Paste
.Cells(d, 3).Cut
.Cells(i, 7).Paste
End With
i = i + 1
Next d
Else
End If
Next sRow