Thread
:
'Loop within a Loop'
View Single Post
#
2
Posted to microsoft.public.excel.programming
Ron de Bruin
external usenet poster
Posts: 11,123
'Loop within a Loop'
Hi Rob
This example will copy to the sheet next to it
Try it on a copy of your workbook
Sub test_1()
For Each cell In Range("K1:K100")
If cell = "X" Then
With Range(Cells(cell.Row, "C"), Cells(cell.Row, "F"))
.Parent.Next.Range(.Address) = .Value
End With
End If
Next cell
End Sub
--
Regards Ron de Bruin
http://www.rondebruin.nl
"Rob Moore" <Rob
wrote in message ...
I am familiar with and use loops on a regular basis but have run into
something I can't figure out.
What I am trying to do at a high level is copy data from one worksheet (old)
to a different worksheet (new).
In 'old' worksheet if column k in any row equals X then copy and paste the
data from columns c,d,e,f of that same row to the same location (row and
column) in the 'new worksheet'.
I started to create a loop to copy data if column K equals X but not sure
how to paste data over to 'new' worksheet.
Thanks in advance for any assistance,
Rob
Reply With Quote
Ron de Bruin
View Public Profile
Find all posts by Ron de Bruin