Hi,
I have the following formula which works fine but is there anyway I could tidy it up as it simply repeats the same process again and again? Its just that when I run the macro you see it jump through each cell and so it looks a bit clunky.
Sub Save_Holidays()
'
' Save_Holidays Macro
'
'
Range("C4").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[17]C[6],RC[4]:RC[34],FALSE)"
Range("C5").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[16]C[6],RC[4]:RC[34],FALSE)"
Range("C6").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[15]C[6],RC[4]:RC[34],FALSE)"
Range("C7").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[14]C[6],RC[4]:RC[34],FALSE)"
Range("C8").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[13]C[6],RC[4]:RC[34],FALSE)"
Range("C9").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[12]C[6],RC[4]:RC[34],FALSE)"
Range("C10").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[11]C[6],RC[4]:RC[34],FALSE)"
Range("C11").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[10]C[6],RC[4]:RC[34],FALSE)"
Range("C12").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[9]C[6],RC[4]:RC[34],FALSE)"
Range("C13").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[8]C[6],RC[4]:RC[34],FALSE)"
Range("C14").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[7]C[6],RC[4]:RC[34],FALSE)"
Range("C15").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[6]C[6],RC[4]:RC[34],FALSE)"
Range("C16").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[5]C[6],RC[4]:RC[34],FALSE)"
Range("C17").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[4]C[6],RC[4]:RC[34],FALSE)"
Range("C18").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[3]C[6],RC[4]:RC[34],FALSE)"
Range("C19").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[2]C[6],RC[4]:RC[34],FALSE)"
Range("E4").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[17]C[11],RC[2]:RC[32])"
Range("E5").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[16]C[11],RC[2]:RC[32])"
Range("E6").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[15]C[11],RC[2]:RC[32])"
Range("E7").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[14]C[11],RC[2]:RC[32])"
Range("E8").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[13]C[11],RC[2]:RC[32])"
Range("E9").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[12]C[11],RC[2]:RC[32])"
Range("E10").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[11]C[11],RC[2]:RC[32])"
Range("E11").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[10]C[11],RC[2]:RC[32])"
Range("E12").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[9]C[11],RC[2]:RC[32])"
Range("E13").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[8]C[11],RC[2]:RC[32])"
Range("E14").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[7]C[11],RC[2]:RC[32])"
Range("E15").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[6]C[11],RC[2]:RC[32])"
Range("E16").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[5]C[11],RC[2]:RC[32])"
Range("E17").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[4]C[11],RC[2]:RC[32])"
Range("E18").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[3]C[11],RC[2]:RC[32])"
Range("E19").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[2]C[11],RC[2]:RC[32])"
Range("F4").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[17]C[16],RC[1]:RC[31], FALSE)"
Range("F5").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[16]C[16],RC[1]:RC[31], FALSE)"
Range("F6").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[15]C[16],RC[1]:RC[31], FALSE)"
Range("F7").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[14]C[16],RC[1]:RC[31], FALSE)"
Range("F8").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[13]C[16],RC[1]:RC[31], FALSE)"
Range("F9").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[12]C[16],RC[1]:RC[31], FALSE)"
Range("F10").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[11]C[16],RC[1]:RC[31], FALSE)"
Range("F11").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[10]C[16],RC[1]:RC[31], FALSE)"
Range("F12").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[9]C[16],RC[1]:RC[31], FALSE)"
Range("F13").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[8]C[16],RC[1]:RC[31], FALSE)"
Range("F14").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[7]C[16],RC[1]:RC[31], FALSE)"
Range("F15").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[6]C[16],RC[1]:RC[31], FALSE)"
Range("F16").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[5]C[16],RC[1]:RC[31], FALSE)"
Range("F17").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[4]C[16],RC[1]:RC[31], FALSE)"
Range("F18").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[3]C[16],RC[1]:RC[31], FALSE)"
Range("F19").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[2]C[16],RC[1]:RC[31], FALSE)"
Range("F20").Select
End Sub
Any help would be great thanks.
I have the following formula which works fine but is there anyway I could tidy it up as it simply repeats the same process again and again? Its just that when I run the macro you see it jump through each cell and so it looks a bit clunky.
Sub Save_Holidays()
'
' Save_Holidays Macro
'
'
Range("C4").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[17]C[6],RC[4]:RC[34],FALSE)"
Range("C5").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[16]C[6],RC[4]:RC[34],FALSE)"
Range("C6").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[15]C[6],RC[4]:RC[34],FALSE)"
Range("C7").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[14]C[6],RC[4]:RC[34],FALSE)"
Range("C8").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[13]C[6],RC[4]:RC[34],FALSE)"
Range("C9").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[12]C[6],RC[4]:RC[34],FALSE)"
Range("C10").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[11]C[6],RC[4]:RC[34],FALSE)"
Range("C11").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[10]C[6],RC[4]:RC[34],FALSE)"
Range("C12").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[9]C[6],RC[4]:RC[34],FALSE)"
Range("C13").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[8]C[6],RC[4]:RC[34],FALSE)"
Range("C14").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[7]C[6],RC[4]:RC[34],FALSE)"
Range("C15").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[6]C[6],RC[4]:RC[34],FALSE)"
Range("C16").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[5]C[6],RC[4]:RC[34],FALSE)"
Range("C17").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[4]C[6],RC[4]:RC[34],FALSE)"
Range("C18").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[3]C[6],RC[4]:RC[34],FALSE)"
Range("C19").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[2]C[6],RC[4]:RC[34],FALSE)"
Range("E4").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[17]C[11],RC[2]:RC[32])"
Range("E5").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[16]C[11],RC[2]:RC[32])"
Range("E6").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[15]C[11],RC[2]:RC[32])"
Range("E7").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[14]C[11],RC[2]:RC[32])"
Range("E8").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[13]C[11],RC[2]:RC[32])"
Range("E9").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[12]C[11],RC[2]:RC[32])"
Range("E10").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[11]C[11],RC[2]:RC[32])"
Range("E11").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[10]C[11],RC[2]:RC[32])"
Range("E12").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[9]C[11],RC[2]:RC[32])"
Range("E13").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[8]C[11],RC[2]:RC[32])"
Range("E14").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[7]C[11],RC[2]:RC[32])"
Range("E15").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[6]C[11],RC[2]:RC[32])"
Range("E16").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[5]C[11],RC[2]:RC[32])"
Range("E17").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[4]C[11],RC[2]:RC[32])"
Range("E18").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[3]C[11],RC[2]:RC[32])"
Range("E19").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[2]C[11],RC[2]:RC[32])"
Range("F4").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[17]C[16],RC[1]:RC[31], FALSE)"
Range("F5").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[16]C[16],RC[1]:RC[31], FALSE)"
Range("F6").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[15]C[16],RC[1]:RC[31], FALSE)"
Range("F7").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[14]C[16],RC[1]:RC[31], FALSE)"
Range("F8").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[13]C[16],RC[1]:RC[31], FALSE)"
Range("F9").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[12]C[16],RC[1]:RC[31], FALSE)"
Range("F10").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[11]C[16],RC[1]:RC[31], FALSE)"
Range("F11").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[10]C[16],RC[1]:RC[31], FALSE)"
Range("F12").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[9]C[16],RC[1]:RC[31], FALSE)"
Range("F13").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[8]C[16],RC[1]:RC[31], FALSE)"
Range("F14").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[7]C[16],RC[1]:RC[31], FALSE)"
Range("F15").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[6]C[16],RC[1]:RC[31], FALSE)"
Range("F16").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[5]C[16],RC[1]:RC[31], FALSE)"
Range("F17").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[4]C[16],RC[1]:RC[31], FALSE)"
Range("F18").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[3]C[16],RC[1]:RC[31], FALSE)"
Range("F19").Select
ActiveCell.FormulaR1C1 = "=ColorFunction(R[2]C[16],RC[1]:RC[31], FALSE)"
Range("F20").Select
End Sub
Any help would be great thanks.