ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy paste code fails (https://www.excelbanter.com/excel-programming/350623-copy-paste-code-fails.html)

Ron Dean[_2_]

Copy paste code fails
 
In using the attached code the code stops after coping & pasting the 1st
line of the 2nd last sheet. Any clever ideas guys ?

Dim r As Integer
' ''''''''''''''''''''''''''''''''from row 2
r = 2
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets

Dim Rng As Range
Dim i As Range
Set Rng = ws.Range("K2", ws.Range("K" & ws.Rows.Count).End(xlUp))
For Each i In Rng
If i = "" Then
i.EntireRow.Copy
SHT.Range("K" & Rows.Count).End(xlUp)(r). _
EntireRow.PasteSpecial
r = r + 1

End If
Next i

Next ws




All times are GMT +1. The time now is 08:47 AM.

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