Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
copy rows and paste onto visible only
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 |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
copy rows and paste onto visible only
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 -- Regards Dave Hawley www.ozgrid.com "rk0909" wrote in message ... 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 |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
copy rows and paste onto visible only
Oops "Application.ScreenUpdating = False"
Should be; Application.CutCopyMode=False -- Regards Dave Hawley www.ozgrid.com "ozgrid.com" wrote in message ... 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 -- Regards Dave Hawley www.ozgrid.com "rk0909" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
COPY PASTE VALUES ONLY FROM/ON VISIBLE CELLS | Excel Discussion (Misc queries) | |||
Copy and paste VISIBLE data | Excel Discussion (Misc queries) | |||
Copy and paste visible cells to outlook | Excel Discussion (Misc queries) | |||
Copy/Paste Visible cells only | Excel Discussion (Misc queries) | |||
copy and paste visible columns | Excel Discussion (Misc queries) |