I am working on a small project which requires me to copy and paste certain columns if I detect \"true\" in the row. I am trying to paste these selected columns onto a diffe
Your copy/paste can be shortened considerably...
' CopyIfTrue()
Dim Col As Range, Cell As Excel.Range, RowCount As Integer
Dim nysheet As Worksheet, shtFI As Worksheet
Set shtFI = Sheets("FemImplant")
Set nysheet = Sheets.Add()
nysheet.Name = "T1"
RowCount = shtFI.UsedRange.Rows.Count
Set Col = shtFI.Range("I2:I" & RowCount)
Dim i As Integer
i = 1
For Each Cell In Col.Cells
If Cell.Value = "True" Then
Cell.Copy nysheet.Range("B" & i)
nysheet.Range("A" & i).Value = _
shtFI.Cells(Cell.Row, 2).Value
i = i + 1
End If
Next