Getting formula to run faster

LynnyWeb

New Member
Joined
Feb 13, 2011
Messages
34
Hi I have the following code, it works but take forever to run, is there anyway I can tidy it up to stop it being so clunky? Thanks

Save_Hols Macro
'
'
Range("C8").FormulaR1C1 = _
"=CountColorCell(R[-6]C[6],RC[4]:RC[35],R[21]C[4]:R[21]C[35],R[42]C[4]:R[42]C[35],R[63]C[4]:R[63]C[35],R[84]C[4]:R[84]C[35],R[105]C[4]:R[105]C[35])/2"
Range("E8").FormulaR1C1 = _
"=CountColorCell(R[-6]C[10],RC[2]:RC[33],R[21]C[2]:R[21]C[33],R[42]C[2]:R[42]C[33],R[63]C[2]:R[63]C[33],R[84]C[2]:R[84]C[33],R[105]C[2]:R[105]C[33])/2"
Range("F8").FormulaR1C1 = _
"=CountColorCell(R[-6]C[15],RC[1]:RC[32],R[21]C[1]:R[21]C[32],R[42]C[1]:R[42]C[32],R[63]C[1]:R[63]C[32],R[84]C[1]:R[84]C[32],R[105]C[1]:R[105]C[32])/2"
Range("C9").FormulaR1C1 = _
"=CountColorCell(R[-7]C[6],RC[4]:RC[35],R[21]C[4]:R[21]C[35],R[42]C[4]:R[42]C[35],R[63]C[4]:R[63]C[35],R[84]C[4]:R[84]C[35],R[105]C[4]:R[105]C[35])/2"
Range("E9").FormulaR1C1 = _
"=CountColorCell(R[-7]C[10],RC[2]:RC[33],R[21]C[2]:R[21]C[33],R[42]C[2]:R[42]C[33],R[63]C[2]:R[63]C[33],R[84]C[2]:R[84]C[33],R[105]C[2]:R[105]C[33])/2"
Range("F9").FormulaR1C1 = _
"=CountColorCell(R[-7]C[15],RC[1]:RC[32],R[21]C[1]:R[21]C[32],R[42]C[1]:R[42]C[32],R[63]C[1]:R[63]C[32],R[84]C[1]:R[84]C[32],R[105]C[1]:R[105]C[32])/2"
Range("C10").FormulaR1C1 = _
"=CountColorCell(R[-8]C[6],RC[4]:RC[35],R[21]C[4]:R[21]C[35],R[42]C[4]:R[42]C[35],R[63]C[4]:R[63]C[35],R[84]C[4]:R[84]C[35],R[105]C[4]:R[105]C[35])/2"
Range("E10").FormulaR1C1 = _
"=CountColorCell(R[-8]C[10],RC[2]:RC[33],R[21]C[2]:R[21]C[33],R[42]C[2]:R[42]C[33],R[63]C[2]:R[63]C[33],R[84]C[2]:R[84]C[33],R[105]C[2]:R[105]C[33])/2"
Range("F10").FormulaR1C1 = _
"=CountColorCell(R[-8]C[15],RC[1]:RC[32],R[21]C[1]:R[21]C[32],R[42]C[1]:R[42]C[32],R[63]C[1]:R[63]C[32],R[84]C[1]:R[84]C[32],R[105]C[1]:R[105]C[32])/2"
Range("C11").FormulaR1C1 = _
"=CountColorCell(R[-9]C[6],RC[4]:RC[35],R[21]C[4]:R[21]C[35],R[42]C[4]:R[42]C[35],R[63]C[4]:R[63]C[35],R[84]C[4]:R[84]C[35],R[105]C[4]:R[105]C[35])/2"
Range("E11").FormulaR1C1 = _
"=CountColorCell(R[-9]C[10],RC[2]:RC[33],R[21]C[2]:R[21]C[33],R[42]C[2]:R[42]C[33],R[63]C[2]:R[63]C[33],R[84]C[2]:R[84]C[33],R[105]C[2]:R[105]C[33])/2"
Range("F11").FormulaR1C1 = _
"=CountColorCell(R[-9]C[15],RC[1]:RC[32],R[21]C[1]:R[21]C[32],R[42]C[1]:R[42]C[32],R[63]C[1]:R[63]C[32],R[84]C[1]:R[84]C[32],R[105]C[1]:R[105]C[32])/2"
Range("C12").FormulaR1C1 = _
"=CountColorCell(R[-10]C[6],RC[4]:RC[35],R[21]C[4]:R[21]C[35],R[42]C[4]:R[42]C[35],R[63]C[4]:R[63]C[35],R[84]C[4]:R[84]C[35],R[105]C[4]:R[105]C[35])/2"
Range("E12").FormulaR1C1 = _
"=CountColorCell(R[-10]C[10],RC[2]:RC[33],R[21]C[2]:R[21]C[33],R[42]C[2]:R[42]C[33],R[63]C[2]:R[63]C[33],R[84]C[2]:R[84]C[33],R[105]C[2]:R[105]C[33])/2"
Range("F12").FormulaR1C1 = _
"=CountColorCell(R[-10]C[15],RC[1]:RC[32],R[21]C[1]:R[21]C[32],R[42]C[1]:R[42]C[32],R[63]C[1]:R[63]C[32],R[84]C[1]:R[84]C[32],R[105]C[1]:R[105]C[32])/2"
Range("C13").FormulaR1C1 = _
"=CountColorCell(R[-11]C[6],RC[4]:RC[35],R[21]C[4]:R[21]C[35],R[42]C[4]:R[42]C[35],R[63]C[4]:R[63]C[35],R[84]C[4]:R[84]C[35],R[105]C[4]:R[105]C[35])/2"
Range("E13").FormulaR1C1 = _
"=CountColorCell(R[-11]C[10],RC[2]:RC[33],R[21]C[2]:R[21]C[33],R[42]C[2]:R[42]C[33],R[63]C[2]:R[63]C[33],R[84]C[2]:R[84]C[33],R[105]C[2]:R[105]C[33])/2"
Range("F13").FormulaR1C1 = _
"=CountColorCell(R[-11]C[15],RC[1]:RC[32],R[21]C[1]:R[21]C[32],R[42]C[1]:R[42]C[32],R[63]C[1]:R[63]C[32],R[84]C[1]:R[84]C[32],R[105]C[1]:R[105]C[32])/2"
Range("C14").FormulaR1C1 = _
"=CountColorCell(R[-12]C[6],RC[4]:RC[35],R[21]C[4]:R[21]C[35],R[42]C[4]:R[42]C[35],R[63]C[4]:R[63]C[35],R[84]C[4]:R[84]C[35],R[105]C[4]:R[105]C[35])/2"
Range("E14").FormulaR1C1 = _
"=CountColorCell(R[-12]C[10],RC[2]:RC[33],R[21]C[2]:R[21]C[33],R[42]C[2]:R[42]C[33],R[63]C[2]:R[63]C[33],R[84]C[2]:R[84]C[33],R[105]C[2]:R[105]C[33])/2"
Range("F14").FormulaR1C1 = _
"=CountColorCell(R[-12]C[15],RC[1]:RC[32],R[21]C[1]:R[21]C[32],R[42]C[1]:R[42]C[32],R[63]C[1]:R[63]C[32],R[84]C[1]:R[84]C[32],R[105]C[1]:R[105]C[32])/2"
Range("C15").FormulaR1C1 = _
"=CountColorCell(R[-13]C[6],RC[4]:RC[35],R[21]C[4]:R[21]C[35],R[42]C[4]:R[42]C[35],R[63]C[4]:R[63]C[35],R[84]C[4]:R[84]C[35],R[105]C[4]:R[105]C[35])/2"
Range("E15").FormulaR1C1 = _
"=CountColorCell(R[-13]C[10],RC[2]:RC[33],R[21]C[2]:R[21]C[33],R[42]C[2]:R[42]C[33],R[63]C[2]:R[63]C[33],R[84]C[2]:R[84]C[33],R[105]C[2]:R[105]C[33])/2"
Range("F15").FormulaR1C1 = _
"=CountColorCell(R[-13]C[15],RC[1]:RC[32],R[21]C[1]:R[21]C[32],R[42]C[1]:R[42]C[32],R[63]C[1]:R[63]C[32],R[84]C[1]:R[84]C[32],R[105]C[1]:R[105]C[32])/2"
Range("C16").FormulaR1C1 = _
"=CountColorCell(R[-14]C[6],RC[4]:RC[35],R[21]C[4]:R[21]C[35],R[42]C[4]:R[42]C[35],R[63]C[4]:R[63]C[35],R[84]C[4]:R[84]C[35],R[105]C[4]:R[105]C[35])/2"
Range("E16").FormulaR1C1 = _
"=CountColorCell(R[-14]C[10],RC[2]:RC[33],R[21]C[2]:R[21]C[33],R[42]C[2]:R[42]C[33],R[63]C[2]:R[63]C[33],R[84]C[2]:R[84]C[33],R[105]C[2]:R[105]C[33])/2"
Range("F16").FormulaR1C1 = _
"=CountColorCell(R[-14]C[15],RC[1]:RC[32],R[21]C[1]:R[21]C[32],R[42]C[1]:R[42]C[32],R[63]C[1]:R[63]C[32],R[84]C[1]:R[84]C[32],R[105]C[1]:R[105]C[32])/2"
Range("C17").FormulaR1C1 = _
"=CountColorCell(R[-15]C[6],RC[4]:RC[35],R[21]C[4]:R[21]C[35],R[42]C[4]:R[42]C[35],R[63]C[4]:R[63]C[35],R[84]C[4]:R[84]C[35],R[105]C[4]:R[105]C[35])/2"
Range("E17").FormulaR1C1 = _
"=CountColorCell(R[-15]C[10],RC[2]:RC[33],R[21]C[2]:R[21]C[33],R[42]C[2]:R[42]C[33],R[63]C[2]:R[63]C[33],R[84]C[2]:R[84]C[33],R[105]C[2]:R[105]C[33])/2"
Range("F17").FormulaR1C1 = _
"=CountColorCell(R[-15]C[15],RC[1]:RC[32],R[21]C[1]:R[21]C[32],R[42]C[1]:R[42]C[32],R[63]C[1]:R[63]C[32],R[84]C[1]:R[84]C[32],R[105]C[1]:R[105]C[32])/2"
Range("C18").FormulaR1C1 = _
"=CountColorCell(R[-16]C[6],RC[4]:RC[35],R[21]C[4]:R[21]C[35],R[42]C[4]:R[42]C[35],R[63]C[4]:R[63]C[35],R[84]C[4]:R[84]C[35],R[105]C[4]:R[105]C[35])/2"
Range("E18").FormulaR1C1 = _
"=CountColorCell(R[-16]C[10],RC[2]:RC[33],R[21]C[2]:R[21]C[33],R[42]C[2]:R[42]C[33],R[63]C[2]:R[63]C[33],R[84]C[2]:R[84]C[33],R[105]C[2]:R[105]C[33])/2"
Range("F18").FormulaR1C1 = _
"=CountColorCell(R[-16]C[15],RC[1]:RC[32],R[21]C[1]:R[21]C[32],R[42]C[1]:R[42]C[32],R[63]C[1]:R[63]C[32],R[84]C[1]:R[84]C[32],R[105]C[1]:R[105]C[32])/2"
Range("C19").FormulaR1C1 = _
"=CountColorCell(R[-17]C[6],RC[4]:RC[35],R[21]C[4]:R[21]C[35],R[42]C[4]:R[42]C[35],R[63]C[4]:R[63]C[35],R[84]C[4]:R[84]C[35],R[105]C[4]:R[105]C[35])/2"
Range("E19").FormulaR1C1 = _
"=CountColorCell(R[-17]C[10],RC[2]:RC[33],R[21]C[2]:R[21]C[33],R[42]C[2]:R[42]C[33],R[63]C[2]:R[63]C[33],R[84]C[2]:R[84]C[33],R[105]C[2]:R[105]C[33])/2"
Range("F19").FormulaR1C1 = _
"=CountColorCell(R[-17]C[15],RC[1]:RC[32],R[21]C[1]:R[21]C[32],R[42]C[1]:R[42]C[32],R[63]C[1]:R[63]C[32],R[84]C[1]:R[84]C[32],R[105]C[1]:R[105]C[32])/2"
Range("C20").FormulaR1C1 = _
"=CountColorCell(R[-18]C[6],RC[4]:RC[35],R[21]C[4]:R[21]C[35],R[42]C[4]:R[42]C[35],R[63]C[4]:R[63]C[35],R[84]C[4]:R[84]C[35],R[105]C[4]:R[105]C[35])/2"
Range("E20").FormulaR1C1 = _
"=CountColorCell(R[-18]C[10],RC[2]:RC[33],R[21]C[2]:R[21]C[33],R[42]C[2]:R[42]C[33],R[63]C[2]:R[63]C[33],R[84]C[2]:R[84]C[33],R[105]C[2]:R[105]C[33])/2"
Range("F20").FormulaR1C1 = _
"=CountColorCell(R[-18]C[15],RC[1]:RC[32],R[21]C[1]:R[21]C[32],R[42]C[1]:R[42]C[32],R[63]C[1]:R[63]C[32],R[84]C[1]:R[84]C[32],R[105]C[1]:R[105]C[32])/2"
Range("C21").FormulaR1C1 = _
"=CountColorCell(R[-19]C[6],RC[4]:RC[35],R[21]C[4]:R[21]C[35],R[42]C[4]:R[42]C[35],R[63]C[4]:R[63]C[35],R[84]C[4]:R[84]C[35],R[105]C[4]:R[105]C[35])/2"
Range("E21").FormulaR1C1 = _
"=CountColorCell(R[-19]C[10],RC[2]:RC[33],R[21]C[2]:R[21]C[33],R[42]C[2]:R[42]C[33],R[63]C[2]:R[63]C[33],R[84]C[2]:R[84]C[33],R[105]C[2]:R[105]C[33])/2"
Range("F21").FormulaR1C1 = _
"=CountColorCell(R[-19]C[15],RC[1]:RC[32],R[21]C[1]:R[21]C[32],R[42]C[1]:R[42]C[32],R[63]C[1]:R[63]C[32],R[84]C[1]:R[84]C[32],R[105]C[1]:R[105]C[32])/2"
Range("C22").FormulaR1C1 = _
"=CountColorCell(R[-20]C[6],RC[4]:RC[35],R[21]C[4]:R[21]C[35],R[42]C[4]:R[42]C[35],R[63]C[4]:R[63]C[35],R[84]C[4]:R[84]C[35],R[105]C[4]:R[105]C[35])/2"
Range("E22").FormulaR1C1 = _
"=CountColorCell(R[-20]C[10],RC[2]:RC[33],R[21]C[2]:R[21]C[33],R[42]C[2]:R[42]C[33],R[63]C[2]:R[63]C[33],R[84]C[2]:R[84]C[33],R[105]C[2]:R[105]C[33])/2"
Range("F22").FormulaR1C1 = _
"=CountColorCell(R[-20]C[15],RC[1]:RC[32],R[21]C[1]:R[21]C[32],R[42]C[1]:R[42]C[32],R[63]C[1]:R[63]C[32],R[84]C[1]:R[84]C[32],R[105]C[1]:R[105]C[32])/2"
Range("C23").FormulaR1C1 = _
"=CountColorCell(R[-21]C[6],RC[4]:RC[35],R[21]C[4]:R[21]C[35],R[42]C[4]:R[42]C[35],R[63]C[4]:R[63]C[35],R[84]C[4]:R[84]C[35],R[105]C[4]:R[105]C[35])/2"
Range("E23").FormulaR1C1 = _
"=CountColorCell(R[-21]C[10],RC[2]:RC[33],R[21]C[2]:R[21]C[33],R[42]C[2]:R[42]C[33],R[63]C[2]:R[63]C[33],R[84]C[2]:R[84]C[33],R[105]C[2]:R[105]C[33])/2"
Range("F23").FormulaR1C1 = _
"=CountColorCell(R[-21]C[15],RC[1]:RC[32],R[21]C[1]:R[21]C[32],R[42]C[1]:R[42]C[32],R[63]C[1]:R[63]C[32],R[84]C[1]:R[84]C[32],R[105]C[1]:R[105]C[32])/2"
End Sub
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

Forum statistics

Threads
1,224,525
Messages
6,179,319
Members
452,905
Latest member
deadwings

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