Can someone please tell me why this code works...
Code:
If Sheets("Sales Datasheet").Cells(i, "C").Value = "672144" Then
Sheets("Sales Datasheet").Cells(i, "E").EntireRow.Copy Destination:=Sheets("Office View").Range("A" & Rows.Count).End(xlUp).Offset(1)
End If
But this one doesn't.
Code:
If Sheets("Sales Datasheet").Cells(i, "C").Value = byagentcb.value Then
Sheets("Sales Datasheet").Cells(i, "E").EntireRow.Copy Destination:=Sheets("Office View").Range("A" & Rows.Count).End(xlUp).Offset(1)
End If
And if I debug.print byagentcb.value, it is "672144". Column C is a Number Value and I've even tried declaring byagentcb as Integer, Long, and Variant.