Would anyone know an alternative to Offset? I'm using a table, so my current code is:
I'm hoping to do something more along the lines of:
Obviously, the above won't work, but hopefully illustrates what I'm going for. Essentially the same thing as an offset, just using column names instead of counting the number of columns.
The goal is to make it so the macro still works if the column order ever changes.
Code:
For each c in Range("Table1[Entity Code]")
If c. value="x" Then
c.offset(0,-16).value="y"
End If
Next
I'm hoping to do something more along the lines of:
Code:
For each c in Range("Table1[Entity Code]")
If c. value="x" Then
c.Range("Table1[Product Code]").value="y"
End If
Next
Obviously, the above won't work, but hopefully illustrates what I'm going for. Essentially the same thing as an offset, just using column names instead of counting the number of columns.
The goal is to make it so the macro still works if the column order ever changes.