ah2024_2024
New Member
- Joined
- Jun 18, 2024
- Messages
- 14
- Office Version
- 365
- Platform
- Windows
So you guys solved my compile error but I'm back again....I actually revamped the prior code that I sent because I have learned a little bit in the last few days (thanks to you all). But I've run into a stall, and I've spent hours trying to figure it out on my own and can't. I have 2 sheets. My source sheet (deals) and my target sheet (ftw). On my source sheet if column F = fort worth AND column O = Active; then copy the employee name in column D and paste only that name into my target sheet (ftw) but need it to start in A9. I also need it only copy NEW data as it updated and not replace.
Here is what I'm using currently and the dang thing is pasting into J1 and pasting ALL the names and not just those that have the correct "fort worth" AND "active"
Sub TAKE_98765()
Dim rcnt As Long
Dim target As Worksheet
Set Source = ActiveWorkbook.Worksheets("deals")
Set target = ActiveWorkbook.Worksheets("ftw")
For Each c In Source.Range("f1:f20")
If c = "FORT WORTH" And c.Offset(0, 9) = "Active" Then
Range("f2:f20" & i).Offset(0, -2).Copy
target.Range("A" & Rows.Count).End(xlUp).Offset(0, 9).PasteSpecial xlPasteAll
End If
Next c
Application.CutCopyMode = False
End Sub
I have tried changing this line target.Range("A" & Rows.Count).End(xlUp).Offset(0, 9).PasteSpecial xlPasteAll to be target.Range("A" & Rows.Count).End(xlUp).Offset(9, 0).PasteSpecial xlPasteAll to no avail.
Thanks in advance folks!
Here is what I'm using currently and the dang thing is pasting into J1 and pasting ALL the names and not just those that have the correct "fort worth" AND "active"
Sub TAKE_98765()
Dim rcnt As Long
Dim target As Worksheet
Set Source = ActiveWorkbook.Worksheets("deals")
Set target = ActiveWorkbook.Worksheets("ftw")
For Each c In Source.Range("f1:f20")
If c = "FORT WORTH" And c.Offset(0, 9) = "Active" Then
Range("f2:f20" & i).Offset(0, -2).Copy
target.Range("A" & Rows.Count).End(xlUp).Offset(0, 9).PasteSpecial xlPasteAll
End If
Next c
Application.CutCopyMode = False
End Sub
I have tried changing this line target.Range("A" & Rows.Count).End(xlUp).Offset(0, 9).PasteSpecial xlPasteAll to be target.Range("A" & Rows.Count).End(xlUp).Offset(9, 0).PasteSpecial xlPasteAll to no avail.
Thanks in advance folks!