Hi,
thanks for anybodies help on this one,
so I have this formula which appears in column AK,
=IF(COUNTIF(A2:AJ2,"*"&lookups!$G$5&"*"),lookups!$H$5," ")
but what I am having a problem with is the A2:AJ2 - the range, what I have come to realise is this may change based on which column the formula is written in.
Example
I download some data, and my end row is column AJ so the formula gets written in AK. (VBA finds the last used row in the last column moves to the next column adds the formula in AJ - works perfect)
then the next day I download the data again, and find two more columns have been added, so my range now needs to be A2:AL2, the formula would be written in AM2
in other words the range can move from A2 to the cell before the cell where the formula is written,
and work with this formula
=IF(COUNTIF(A2:AJ2,"*"&lookups!$G$5&"*"),lookups!$H$5," ")
for info
lookups!$G$5 = '@A
lookups!$H$5 = "Fail"
so it would be something like =IF(COUNTIF(A2: last used cell before the formula, and then all the rest of the formula.
thanks for any help
David
thanks for anybodies help on this one,
so I have this formula which appears in column AK,
=IF(COUNTIF(A2:AJ2,"*"&lookups!$G$5&"*"),lookups!$H$5," ")
but what I am having a problem with is the A2:AJ2 - the range, what I have come to realise is this may change based on which column the formula is written in.
Example
I download some data, and my end row is column AJ so the formula gets written in AK. (VBA finds the last used row in the last column moves to the next column adds the formula in AJ - works perfect)
then the next day I download the data again, and find two more columns have been added, so my range now needs to be A2:AL2, the formula would be written in AM2
in other words the range can move from A2 to the cell before the cell where the formula is written,
and work with this formula
=IF(COUNTIF(A2:AJ2,"*"&lookups!$G$5&"*"),lookups!$H$5," ")
for info
lookups!$G$5 = '@A
lookups!$H$5 = "Fail"
so it would be something like =IF(COUNTIF(A2: last used cell before the formula, and then all the rest of the formula.
thanks for any help
David