Hi there,
Please can someone help convert =IF(F2=F1,"Y", "N") into R1C1 notation?
Context
I am inputting a formula in column AU which identifies duplicate values based on values in column F.
In excel my formula in cell AU2 would be =IF(F2=F1,"Y", "N").
Cell AU3 would be then be =IF(F3=F2,"Y", "N") etc etc
However, I'm struggling to convert this to R1C1 notation , as I'm fairly new to VBA
My VBA formula is as follows:
' DuplicatesTest Macro
'
Range("AU2").Select
'ActiveCell.FormulaR1C1 = "=IF(R2C6=R[-1]C,""Y"", ""N"")"
Range("AU2").Select
Selection.AutoFill Destination:=Range("AU2:AU5")
Range("AU2:AU5").Select
One way or another, I can't return the right value to AU2 and/ or I can't ensure the column stays fixed (absolute), and the rows remain variable in the formula as the formula fills down. R[-1] in the formula above looks up the value one row above cell AU2, so I know this is incorrect.
I've been struggling on this for about an hour so any help would be appreciated. (Additionally, it's worth noting that I will be writing some other formulas like this so I'm not sure if there is a general steer/ approach to be following here). I think I may be able to put in a relative cell value (e.g. RC-32 to locate the cell from AU2 but will I always need to do that? i.e. can I not simply refer directly to the F2 cell, for example, in R1C1 notation?)
Many thanks
Please can someone help convert =IF(F2=F1,"Y", "N") into R1C1 notation?
Context
I am inputting a formula in column AU which identifies duplicate values based on values in column F.
In excel my formula in cell AU2 would be =IF(F2=F1,"Y", "N").
Cell AU3 would be then be =IF(F3=F2,"Y", "N") etc etc
However, I'm struggling to convert this to R1C1 notation , as I'm fairly new to VBA
My VBA formula is as follows:
' DuplicatesTest Macro
'
Range("AU2").Select
'ActiveCell.FormulaR1C1 = "=IF(R2C6=R[-1]C,""Y"", ""N"")"
Range("AU2").Select
Selection.AutoFill Destination:=Range("AU2:AU5")
Range("AU2:AU5").Select
One way or another, I can't return the right value to AU2 and/ or I can't ensure the column stays fixed (absolute), and the rows remain variable in the formula as the formula fills down. R[-1] in the formula above looks up the value one row above cell AU2, so I know this is incorrect.
I've been struggling on this for about an hour so any help would be appreciated. (Additionally, it's worth noting that I will be writing some other formulas like this so I'm not sure if there is a general steer/ approach to be following here). I think I may be able to put in a relative cell value (e.g. RC-32 to locate the cell from AU2 but will I always need to do that? i.e. can I not simply refer directly to the F2 cell, for example, in R1C1 notation?)
Many thanks