floggingmolly
Board Regular
- Joined
- Sep 14, 2019
- Messages
- 167
- Office Version
- 365
- Platform
- Windows
I have a workbook named SP FAM 2 NEG PULLED.xlsx with Sheet1 containing my data. If column AC contains the word "INVITE" I want to copy columns A - AB into another workbook called FAM ATTENDANCE NEW.xlsx on the last row of sheet named MASTER PHASE 2.
I was using the code below to just paste them into a new sheet, but now I need to copy them into the other workbook under the last row so I can keep track of them on one sheet. Any help would be greatly appreciated.
I was using the code below to just paste them into a new sheet, but now I need to copy them into the other workbook under the last row so I can keep track of them on one sheet. Any help would be greatly appreciated.
Code:
Sub CopyRows()
Dim Cell As Range
With Sheets(1)
' loop column H untill last cell with value (not entire column)
For Each Cell In .Range("AC2:AC" & .Cells(.Rows.Count, "AC").End(xlUp).Row)
If Cell.Value = "Invite" Then
' Copy>>Paste in 1-line (no need to use Select)
.Rows(Cell.Row).Copy Destination:=Sheets(2).Rows(Cell.Row)
End If
Next Cell
End With
End Sub