I have a table in Excel, and in VBA this bit of code:
If TableName(Y, 1) = "Dog" Then
Which works fine, it looks up the value of the first column and checks if it = "Animal" But instead of using (Y, 1), I want to do it by declaring the column header instead of column number, eg: (Y, [AnimalHeader]), but this doesn't work, does anyone know is this is possible and how?
TableNamethe name of aListObjectvariable or what?Y? Some more context please.