storemannequin
Board Regular
- Joined
- May 29, 2010
- Messages
- 108
EDIT: Nevermind, I forgot to reference the original worksheet here. Mods can delete
Not sure exactly why this code is giving me problems, I see that it correctly locates the value of i, but doesn't copy over at all. The title header copies over but not the info in the loop:
Not sure exactly why this code is giving me problems, I see that it correctly locates the value of i, but doesn't copy over at all. The title header copies over but not the info in the loop:
Code:
Sub FedLoop()
FR = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
FC = ActiveSheet.Cells(1, Columns.Count).End(xlToLeft).Column
Set WBO = ActiveWorkbook
Set WSO = ActiveSheet
Set WBD = Workbooks.Add(template:=xlWBATWorksheet)
Set WSD = WBD.Worksheets(1)
WSO.Range("A1").CurrentRegion.Rows(1).Copy Destination:=WSD.Range("A1")
nextrow = 2
For i = 2 To FR
If Cells(i, 2).Value = "peace" Then
WSO.Cells(i, 1).Resize(, FC).Copy Destination:=WSD.Cells(nextrow, 1)
nextrow = nextrow + 1
End If
Next i
End Sub
Last edited: