So I have a formula in the column Max Boxes in my table, I am trying to get it to put the text in my column "Dest Loc ID" which is -6 columns from the range we are looking in.
The formula in the Max Boxes column will place an EDC or WDC in the column depending on criteria in other column but I want to insert EDC/WDC if this is it is marked as EDC or WDC.
Below is my attempt but it marks all the cells in my -6 column ("DEST LOC ID") as EDC/WDC
The formula in the Max Boxes column will place an EDC or WDC in the column depending on criteria in other column but I want to insert EDC/WDC if this is it is marked as EDC or WDC.
Below is my attempt but it marks all the cells in my -6 column ("DEST LOC ID") as EDC/WDC
Code:
Sub EDCWDC()
Dim SWb As Workbook: Set SWb = ThisWorkbook
Dim SS As Worksheet: Set SS = SWb.Sheets("Steri Sheet")
Dim ST As ListObject: Set SS = SWb.Sheets("Steri Sheet")
Dim SteriS As Range: Set SteriS = Range("SteriTable[Max Boxes]")
Dim rng As Range
For Each rng In SteriS
If rng.Cells.Value <> "EDC" Then
rng.Offset(0, -6) = "EDC/WDC"
End If
If rng.Cells.Value <> "WDC" Then
rng.Offset(0, -6) = "EDC/WDC"
End If
Next rng
End Sub