LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copy and Paste to New Workbook

Can someone look at the new code and tell me why it does
not work. It copies all rows with the work Ard in the
worksheet called Ard but it seems to be pasting each row
copied to the same row in the destination. I thought that
a counter would help this. Do I have it in the wrong
place? I think I have tried everywhere. THANKS FOR THE
HELP.

Dim RNG As Range, rng1 As Range
Dim cell As Range

Counter = 0

With Worksheets(2)

On Error Resume Next
Set RNG = .Range(.Cells(2, "L"), _
Cells(Rows.Count, "L").End(xlUp))
Set rng1 = RNG.SpecialCells(xlConstants)
On Error GoTo 0

Counter = 0

If Not rng1 Is Nothing Then
For Each cell In RNG
Counter = 2
If .Cells(cell.Row, "L").Value Like "Ard" Then
Rows(cell.Row).Copy Sheets("Ard").Rows(Counter)
.Cells(cell.Row, "L").Value = "ARD"

End If
Counter = Counter + 2
Next
End If
End With
 
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 workbook to 2nd workbook paste is greyed out elmer Excel Worksheet Functions 2 January 28th 09 06:06 PM
Copy and Paste between workbook Mandy Excel Discussion (Misc queries) 5 September 9th 08 05:49 PM
Copy and Paste from ANOTHER WORKBOOK F. Lawrence Kulchar Excel Discussion (Misc queries) 1 September 12th 06 12:08 PM
copy and paste using code from workbook to workbook bigdaddy3 Excel Discussion (Misc queries) 2 September 14th 05 11:06 AM
I cannot paste from one workbook to another. Copy works, paste do. JimmyMc Excel Discussion (Misc queries) 1 June 10th 05 03:54 PM


All times are GMT +1. The time now is 05:45 PM.

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

About Us

"It's about Microsoft Excel"