montecarlo2012
Well-known Member
- Joined
- Jan 26, 2011
- Messages
- 986
- Office Version
- 2010
- Platform
- Windows
Hi.
I have been doing manually the frequency function, I would like to find how to loop this, by hand will take forever what I am doing, here it is what I got until now.
A macro is worth a thousand words
Thanks.
I have been doing manually the frequency function, I would like to find how to loop this, by hand will take forever what I am doing, here it is what I got until now.
VBA Code:
Sub FREQ_B2()
'B2 TO F10 RESULTS ON CN-CO HIGHLIGHT B1 IS EMPTY
Range("I2:I37").FormulaArray = "=FREQUENCY(B2:F10,H2:H37)"
Range("H2:I37").Copy
Range("CN2").PasteSpecial Paste:=xlPasteValues
End Sub
Sub FREQ_B3()
'B3 TO F11 RESULTS ON ck-cl highlight b2
Range("I2:I37").FormulaArray = "=FREQUENCY(B3:F11,H2:H37)"
Range("H2:I37").Copy
Range("CK2").PasteSpecial Paste:=xlPasteValues
End Sub
Sub FREQ_B4()
'B4 TO F12 RESULTS ON CH/CL HIGHLIGHT B3
Range("I2:I37").FormulaArray = "=FREQUENCY(B4:F12,H2:H37)"
Range("H2:I37").Copy
Range("CH2").PasteSpecial Paste:=xlPasteValues
End Sub
Sub FREQ_B5()
'B5 TO F13 RESULTS ON CE/CF HIGHLIGHT B4
Range("I2:I37").FormulaArray = "=FREQUENCY(B5:F13,H2:H37)"
Range("H2:I37").Copy
Range("CE2").PasteSpecial Paste:=xlPasteValues
End Sub
Sub FREQ_6()
'B6 TO F14 RESULTS ON CB/CC HIGHLIGHT B5
Range("I2:I37").FormulaArray = "=FREQUENCY(B6:F14,H2:H37)"
Range("H2:I37").Copy
Range("CB2").PasteSpecial Paste:=xlPasteValues
End Sub
Sub FREQ_B7()
'B7 TO F15 RESULTS ON BY/BZ HIGHLIGHT B6
Range("I2:I37").FormulaArray = "=FREQUENCY(B7:F15,H2:H37)"
Range("H2:I37").Copy
Range("BY2").PasteSpecial Paste:=xlPasteValues
End Sub
Sub FREQ_B8()
'B8 TO F16 RESULTS ON CN-CO HIGHLIGHT B7
Range("I2:I37").FormulaArray = "=FREQUENCY(B8:F16,H2:H37)"
Range("H2:I37").Copy
Range("BV2").PasteSpecial Paste:=xlPasteValues
End Sub
Sub FREQ_B9()
'B9 TO F17 RESULTS ON ck-cl highlight b8
Range("I2:I37").FormulaArray = "=FREQUENCY(B9:F17,H2:H37)"
Range("H2:I37").Copy
Range("BS2").PasteSpecial Paste:=xlPasteValues
End Sub
Sub FREQ_B10()
'B10 TO F18 RESULTS ON CH/CL HIGHLIGHT B9
Range("I2:I37").FormulaArray = "=FREQUENCY(B10:F18,H2:H37)"
Range("H2:I37").Copy
Range("BP2").PasteSpecial Paste:=xlPasteValues
End Sub
Sub FREQ_B11()
'B11 TO F19 RESULTS ON CE/CF HIGHLIGHT B10
Range("I2:I37").FormulaArray = "=FREQUENCY(B11:F19,H2:H37)"
Range("H2:I37").Copy
Range("BM2").PasteSpecial Paste:=xlPasteValues
End Sub
Sub FREQ_B12()
'B12 TO F20 RESULTS ON CB/CC HIGHLIGHT B11
Range("I2:I37").FormulaArray = "=FREQUENCY(B12:F20,H2:H37)"
Range("H2:I37").Copy
Range("BJ2").PasteSpecial Paste:=xlPasteValues
End Sub
Sub FREQ_B13()
'B13 TO F21 RESULTS ON BY/BZ HIGHLIGHT B12
Range("I2:I37").FormulaArray = "=FREQUENCY(B13:F21,H2:H37)"
Range("H2:I37").Copy
Range("BG2").PasteSpecial Paste:=xlPasteValues
End Sub
Thanks.