I need to add a 2nd condition to my code - but I'm getting an error. I'm not sure how to make it work.
If Len = 3 and UPC is blank, then move the Group Code left 1 column. I've got the action part resolved. its the second condition that has me stumped.
I've tried using 'And' in the same line with the 2 conditions. I've tried what you see below.
The Group codes are in Column C. the UPCs are column E If cells in C, len = 3 AND UPC in same row, column E = "" (blank) then.. proceed otherwise skip.
I added:
Dim UPC As Range
Set UPC = Range("E2:E" & LastRow)
If UPC.Value = "" Then
Here is the code:
'Moving Group Codes
Dim cell As Range
Dim UPC As Range
Set UPC = Range("E2:E" & LastRow)
For Each cell In Intersect(Range("C:C"), ActiveSheet.UsedRange)
If Len(cell.Value) = 3 Then
If UPC.Value = "" Then '<<<<<<this is where i get my error.
cell.Cut Destination:=cell.Offset(columnoffset:=-1)
End If
End If
Next cell