Option ExplicitSub CompareData()'Decalre Variable Dim Adr As String 'Address of Range containing Comparison data' Define Column for Comparison Adr = Range(Cells(2, 5), Cells(1, 5).End(xlDown)).Address Debug.Print "=OR(EXACT(TRIM(RC1)," & Adr & "))" 'analyse if formula is correct'Select Cell for formula Range("B2").Select'Array Formula for Comparison ActiveCell.FormulaArray = "=OR(EXACT(TRIM(RC1)," & Adr & "))"End Sub
The formula ends up calculating this: =OR(EXACT(TRIM(R[-1]C[469]),R2C5:R613C5)) REGARDLESS of how the spreadsheet is set: either R1C1 style or A1 style
I have been unable to find a way of combining ActiveCell.FormulaArray and ActiveCell.FormulaR1C1
rgonzo - you have made what I did work! - exactly what I was looking for.
Barry, you have simplified and improved the results considerably by thinking beyond the obvious.
You have now enabled me to look past exact matches and take into account manually (poorly) entered and duplicate data. The words,"Can't see the wood for the trees" enters my mind.
I hope you will be content with barry 270 points for improving and rgonzo for 230 for ansering what i asked!
Barry and Rgonzo
I am delighted with both your contributions.
rgonzo - you have made what I did work! - exactly what I was looking for.
Barry, you have simplified and improved the results considerably by thinking beyond the obvious.
You have now enabled me to look past exact matches and take into account manually (poorly) entered and duplicate data. The words,"Can't see the wood for the trees" enters my mind.
I hope you will be content with barry 270 points for improving and rgonzo for 230 for ansering what i asked!
Cheers!
David