Hi Guys,
Could you assist me with the below please,
I want to just copy rows A:F when column A contains the word SSN. at the moment it copys the entire row, cannot figure this one out.
Private Sub Workbook_Open2()
Dim i, LastRow
LastRow = Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Row
For i = 2 To LastRow
If Sheets("Sheet1").Cells(i, "A").Value Like "*SIM*" Then
Sheets("Sheet1").Cells(i, "A").EntireRow.Copy Destination:=Sheets("SIM").Range("A" & Rows.Count).End(xlUp).Offset(1)
End If
Next i
For i = 2 To LastRow
If Sheets("Sheet1").Cells(i, "A").Value Like "*SSN*" Then
Sheets("Sheet1").Cells(i, "A").EntireRow.Copy Destination:=Sheets("SIM").Range("A" & Rows.Count).End(xlUp).Offset(1)
End If
Next i
End Sub
Thanks
Could you assist me with the below please,
I want to just copy rows A:F when column A contains the word SSN. at the moment it copys the entire row, cannot figure this one out.
Private Sub Workbook_Open2()
Dim i, LastRow
LastRow = Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Row
For i = 2 To LastRow
If Sheets("Sheet1").Cells(i, "A").Value Like "*SIM*" Then
Sheets("Sheet1").Cells(i, "A").EntireRow.Copy Destination:=Sheets("SIM").Range("A" & Rows.Count).End(xlUp).Offset(1)
End If
Next i
For i = 2 To LastRow
If Sheets("Sheet1").Cells(i, "A").Value Like "*SSN*" Then
Sheets("Sheet1").Cells(i, "A").EntireRow.Copy Destination:=Sheets("SIM").Range("A" & Rows.Count).End(xlUp).Offset(1)
End If
Next i
End Sub
Thanks