vba. FormulaArray in a loop. "=FREQUENCY(Sheet2!R[2]C[9]:R[2]C[1460],Sheet1!RC[-3]:R[100]C[-3])"

montecarlo2012

Well-known Member
Joined
Jan 26, 2011
Messages
984
Office Version
  1. 2010
Platform
  1. Windows
Hello.
VBA Code:
Sub Macro1()

    Range("B2:B102").Select
    Selection.FormulaArray = _
        "=FREQUENCY(Sheet2!RC[11]:RC[1528],Sheet1!RC[-1]:R[100]C[-1])"
    
End Sub
Sub Macro2()

    Range("C2:C102").Select
    Selection.FormulaArray = _
        "=FREQUENCY(Sheet2!R[1]C[10]:R[1]C[1482],Sheet1!RC[-2]:R[100]C[-2])"
   
End Sub
Sub Macro3()

    Range("D2:D102").Select
    Selection.FormulaArray = _
        "=FREQUENCY(Sheet2!R[2]C[9]:R[2]C[1460],Sheet1!RC[-3]:R[100]C[-3])"
   
End Sub
Thank you for reading this.
I don't know how to loop all these little macros.
my reading data are at sheet2 M2:M37 to the last row on each row, (each row is different)
my display data will be at sheet1 B2:B102
Have a nice Sunday.
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Hi. I am still doing what I understand.
so.
Range("G2:G102").FormulaArray = "=FREQUENCY(Sheet2!M7:BMW7,Sheet1!A2:A101)"
if I repeat this line 37 time look like this:
1660496149407.png

then I putting some code like:
VBA Code:
Sub wrong()

Dim I, j as variant
Dim LastColumn As Long

ActiveSheet.UsedRange
LastColumn = ActiveSheet.UsedRange.Columns(ActiveSheet.UsedRange.Columns.Count).Column

For I = 2 to 102
          For j = 2 to LastColumn
                        Sheet1!Cells(I + 1,j + 1).formulaArray = “=frequency(sheet2! & j + 1 &”,sheet1!A2:A101)”

          Next j

Next I

End sub
and ... nothing
but I did something.
 
Upvote 0

Forum statistics

Threads
1,214,611
Messages
6,120,513
Members
448,967
Latest member
screechyboy79

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