Help with formula

braidp

New Member
Joined
Dec 27, 2018
Messages
39
Hi Guys,

Thanks in advance for your help!!!

I am trying to edit an existing sheet that we have at work. There is a button that clears all previous records and then a 2nd button that resets the formula. (The VBA for resetting the formula is pasted below)

When I hit the reset button all cells revert to the calculation of =IF(T5,1,"") for example resulting in the line of cells from U5:AN5 reverting to a value of 1.

What I would like to do is revert certain cells to a different value
for example:
U5:U10 would revert to the value of 2 also U12:17, U19:U24, U26:U31
V5:V10 Would revert to the value of 4 also V12:17, V19:V24, V26:V31

etc, etc..................can anyone direct me to where I would edit this to allow this to work


Any help would be fantastic!!!

Regards,

Paul



Code:
Sub RESET_FORMULAS()
'
' RESET_FORMULAS Macro
' RESET AND CLEAR CFF RECORDS
'


'
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("U5").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("V5").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("W5").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("X5").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Y5").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Z5").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AA5").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AB5").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AC5").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AD5").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AE5").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AF5").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AG5").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AH5").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AI5").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AJ5").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AK5").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AL5").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AM5").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AN5").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("U6").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("U6").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("V6").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("W6").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("X6").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Y6").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Z6").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AA6").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AB6").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AC6").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AD6").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AE6").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AF6").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AG6").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AH6").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AI6").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AJ6").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AK6").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AL6").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AM6").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AN6").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("U7").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("U7").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("V7").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("W7").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("X7").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Y7").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Z7").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AA7").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AB7").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AC7").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AD7").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AE7").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AF7").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AG7").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AH7").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AI7").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AJ7").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AK7").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AL7").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AM7").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AN7").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("U8").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("V8").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("W8").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("X8").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Y8").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Z8").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AA8").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AB8").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AC8").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AD8").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AE8").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AF8").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AG8").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AH8").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AI8").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AJ8").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AK8").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AL8").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AM8").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AN8").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("U9").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("V9").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("W9").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("X9").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Y9").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Z9").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AA9").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AB9").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AC9").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AD9").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AE9").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AF9").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AG9").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AH9").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AI9").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AJ9").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AK9").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AL9").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AM9").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AN9").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("U10").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("V10").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("W10").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("X10").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Y10").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Z10").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AA10").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AB10").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AC10").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AD10").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AE10").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AF10").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AG10").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AH10").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AI10").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AJ10").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AK10").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AL10").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AM10").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AN10").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("U12").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("V12").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("W12").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("X12").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Y12").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Z12").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AA12").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AB12").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AC12").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AD12").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AE12").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AF12").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AG12").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AH12").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AI12").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AJ12").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AK12").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AL12").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AM12").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AN12").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("U13").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("V13").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("W13").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("X13").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Y13").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Z13").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AA13").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AB13").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AC13").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AD13").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AE13").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AF13").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AG13").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AH13").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AI13").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AJ13").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AK13").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AL13").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AM13").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AN13").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("U14").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("V14").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("W14").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("X14").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Y14").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Z14").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AA14").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AB14").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AC14").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AD14").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AE14").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AF14").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AG14").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AH14").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AI14").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AJ14").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AK14").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AL14").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AM14").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AN14").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("U15").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("V15").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("W15").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("X15").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Y15").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Z15").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AA15").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AB15").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AC15").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AD15").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AE15").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AF15").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AG15").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AH15").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AI15").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AJ15").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AK15").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AL15").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AM15").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AN15").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("U16").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("V16").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("W16").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("X16").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Y16").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Z16").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AA16").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AB16").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AC16").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AD16").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AE16").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AF16").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AG16").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AH16").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AI16").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AJ16").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AK16").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AL16").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AM16").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AN16").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("U17").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("V17").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("W17").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("X17").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Y17").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Z17").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AA17").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AB17").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AC17").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AD17").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AE17").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AF17").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AG17").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AH17").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AI17").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AJ17").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AK17").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AL17").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AM17").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AN17").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    
       ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("U19").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("V19").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("W19").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("X19").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Y19").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Z19").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AA19").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AB19").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AC19").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AD19").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AE19").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AF19").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AG19").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AH19").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AI19").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AJ19").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AK19").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AL19").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AM19").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AN19").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    
       ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("U20").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("V20").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("W20").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("X20").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Y20").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Z20").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AA20").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AB20").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AC20").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AD20").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AE20").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AF20").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AG20").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AH20").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AI20").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AJ20").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AK20").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AL20").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AM20").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AN20").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    
       ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("U21").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("V21").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("W21").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("X21").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Y21").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Z21").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AA21").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AB21").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AC21").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AD21").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AE21").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AF21").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AG21").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AH21").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AI21").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AJ21").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AK21").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AL21").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AM21").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AN21").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    
       ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("U22").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("V22").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("W22").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("X22").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Y22").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Z22").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AA22").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AB22").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AC22").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AD22").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AE22").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AF22").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AG22").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AH22").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AI22").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AJ22").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AK22").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AL22").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AM22").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AN22").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    
       ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("U23").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("V23").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("W23").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("X23").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Y23").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Z23").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AA23").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AB23").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AC23").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AD23").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AE23").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AF23").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AG23").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AH23").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AI23").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AJ23").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AK23").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AL23").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AM23").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AN23").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    
       ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("U24").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("V24").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("W24").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("X24").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Y24").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Z24").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AA24").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AB24").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AC24").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AD24").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AE24").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AF24").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AG24").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AH24").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AI24").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AJ24").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AK24").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AL24").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AM24").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AN24").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"


       ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("U26").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("V26").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("W26").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("X26").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Y26").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Z26").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AA26").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AB26").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AC26").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AD26").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AE26").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AF26").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AG26").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AH26").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AI26").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AJ26").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AK26").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AL26").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AM26").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AN26").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    
       ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("U27").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("V27").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("W27").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("X27").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Y27").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Z27").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AA27").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AB27").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AC27").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AD27").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AE27").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AF27").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AG27").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AH27").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AI27").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AJ27").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AK27").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AL27").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AM27").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AN27").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    
       ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("U28").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("V28").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("W28").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("X28").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Y28").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Z28").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AA28").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AB28").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AC28").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AD28").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AE28").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AF28").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AG28").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AH28").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AI28").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AJ28").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AK28").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AL28").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AM28").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AN28").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    
        ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("U29").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("V29").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("W29").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("X29").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Y29").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Z29").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AA29").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AB29").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AC29").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AD29").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AE29").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AF29").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AG29").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AH29").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AI29").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AJ29").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AK29").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AL29").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AM29").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AN29").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    
        ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("U30").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("V30").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("W30").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("X30").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Y30").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Z30").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AA30").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AB30").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AC30").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AD30").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AE30").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AF30").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AG30").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AH30").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AI30").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AJ30").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AK30").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AL30").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AM30").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AN30").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"


        ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("U31").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("V31").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("W31").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("X31").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Y31").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("Z31").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AA31").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AB31").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AC31").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AD31").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AE31").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AF31").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AG31").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AH31").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AI31").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AJ31").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AK31").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AL31").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AM31").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
    Range("AN31").Select
    ActiveCell.FormulaR1C1 = "=IF(RC20,1,"""")"
End Sub
 
Last edited by a moderator:

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Am no VBA expert but replace all that code with this for a start!

Code:
Range("U5:AN5").Formula = "=IF($RC$20,1,"""")"
Range("U19:AN24").Formula = "=IF($RC$20,1,"""")"
Range("U26:AN31").Formula = "=IF($RC$20,1,"""")"
 
Upvote 0
Maybe this:
Code:
Dim rng As Range

Set rng = Union(Range("U5:AN10"), Range("U12:AN17"), Range("U19:AN24"), Range("U26:AN31"))
rng.FormulaR1C1 = "=IF(RC20,2*COLUMNS(RC21:RC),"""")"
 
Upvote 0
Many thanks this works for the 2 columns I mentioned U & V however the remaining rows go up in multiples instead of the value I want to set?
The values I'd like are
W=4
X=4
Y=4
Z=2
AA=2
AB=2
AE:BI=1

all the row ranges remain the same so 5:10, 12:17, 19:24, 26:31

Thanks for your help

Paul
 
Upvote 0

Forum statistics

Threads
1,224,938
Messages
6,181,866
Members
453,068
Latest member
DCD1872

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top