copy rows and paste onto visible only

  • Thread starter Thread starter rk0909
  • Start date Start date
R

rk0909

All,

I want to copy say 10 rows and then paste into another 10 rows. Problem is
the destination rows are not contiguous. there are 4-5 rows in between each
of these rows which are grouped.

is there a way to do that. I tried the visible cells property but that does
not work.

Any help of direction is much appreciated.

thanks much,

RK
 
Something like;

Sub CopyToVisibleRows()
Dim rCell As Range, rCell2 As Range
Dim lPasteRow As Long

lPasteRow = 1
For Each rCell In Sheet1.Range("A1:A10")
rCell.EntireRow.Copy
For Each rCell2 In Sheet2.Range("A1:A100")
If rCell2.EntireRow.Hidden = False And rCell2.Row > lPasteRow
Then
lPasteRow = rCell2.Row
rCell2.PasteSpecial
Application.ScreenUpdating = False
End If
Next rCell2
Next rCell
End Sub
 
Oops "Application.ScreenUpdating = False"

Should be;
Application.CutCopyMode=False
 
Back
Top