Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 50
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 464
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 464
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
COPY PASTE VALUES ONLY FROM/ON VISIBLE CELLS FARAZ QURESHI Excel Discussion (Misc queries) 6 April 29th 09 01:32 PM
Copy and paste VISIBLE data Jaytee Excel Discussion (Misc queries) 3 November 1st 08 09:13 PM
Copy and paste visible cells to outlook Tania UK Excel Discussion (Misc queries) 1 June 26th 07 02:56 PM
Copy/Paste Visible cells only Ashley Excel Discussion (Misc queries) 1 October 17th 06 09:17 PM
copy and paste visible columns ferde Excel Discussion (Misc queries) 1 December 8th 05 08:42 AM


All times are GMT +1. The time now is 07:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"