In myexcel I wanted to calculate the difference in days between a Single Date in a cell and a series of Dates in column AS2:AS400
Also the difference in days i want it in a seperate column.
I tried to understand the code via record macro and modify it to a two line code. But I couldnt not make it. Could anyone simplyfy the below code to simplfied program. So that I can use for a large no. of data very easily in a column instead of writing it for every single cell.
Range("AS2").Select
ActiveCell.FormulaR1C1 = "=R[3]C[-42]-RC[-22]"
Range("AS3").Select
ActiveCell.FormulaR1C1 = "=R[2]C[-42]-RC[-22]"
Range("AS4").Select
ActiveCell.FormulaR1C1 = "=R[1]C[-42]-RC[-22]"
Range("AS5").Select
ActiveCell.FormulaR1C1 = "=RC[-42]-RC[-22]"
Range("AS6").Select
ActiveCell.FormulaR1C1 = "=R[-1]C[-42]-RC[-22]"
Range("AS7").Select
ActiveCell.FormulaR1C1 = "=R[-2]C[-42]-RC[-22]"
Range("AS8").Select
ActiveCell.FormulaR1C1 = "=R[-3]C[-42]-RC[-22]"