Jon von der Heyden
MrExcel MVP, Moderator
- Joined
- Apr 6, 2004
- Messages
- 10,904
- Office Version
- 365
- Platform
- Windows
Hi,
I've written the following code:
Basically, all I want is to copy the row when c.value = tgt, but it doesn't like the syntax I'm trying. Once copied I want to move it to a sheet called "output" and paste to the next empty row (but I should be fine with this piece of code).
Cheers,
Jon
I've written the following code:
Code:
Sub Simulate()
Application.Calculation = xlCalculationManual
Dim c As Range
For i = 1 To 675
For Each c In Range("rng")
If c.Value = Range("tgt").Value Then
Rows(c).Copy
End If
Next c
Calculate
Next
Application.Calculation = xlCalculationAutomatic
End Sub
Basically, all I want is to copy the row when c.value = tgt, but it doesn't like the syntax I'm trying. Once copied I want to move it to a sheet called "output" and paste to the next empty row (but I should be fine with this piece of code).
Cheers,
Jon