I have to perform checks on a spreadsheet which i am trying to automate, one of the checks is to see if the
first three characters of the cell meet a specific requirement.
If the cell contains "ABC123" it can be
ignored and move on to the next row
If the cell contains "abc123" the row needs to be cut and placed on a different sheet
If the cell contains "Abc1234" the row needs to be cut and placed on a different sheet
If the cell contains "1234" the row needs to be cut and placed on a different sheet
Dim myLoop As Long
Dim myURange As String
Dim var1 As String
myURange = ThisWorkbook.Worksheets("Sheet1").UsedRange.Rows.Count
For myLoop = 2 To myURange
If ThisWorkbook.Worksheets("Sheet1").Range("B" & myLoop).Text <> "" Then
var1 = Cells(myLoop, 12) = Left(Cells(myLoop, 12), 3)
If var1 = "ABC" Then
Rows(myLoop & ":" & myLoop).Select
Set wksheetPasteTo = ThisWorkbook.Worksheets("Sheet2")
Set rngPasteTo = wksheetPasteTo.Range("a1")
Do Until rngPasteTo = ""
Set rngPasteTo = rngPasteTo.Offset(1)
When i run the code, every row is being copied onto Sheet2, where am i going wrong?
Thanks in Advance