How to use frequency function in code

jazztech

Board Regular
Joined
Aug 31, 2007
Messages
119
Hi All,
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
I have a large amount of data to process with the frequency function. The data_array and bin_array are changing from file to file, however the bin_array is always evenly distributed and symmetric i.e -200, -150, -100 …. 100, 150, 200.
<o:p></o:p>
The user has to input 4 variables, two to describe the bin_array by the highest abs value of the bin (200 in the above example) and the bin_width (10 in the above example).
The other two variables indicate where is the data in the spreadsheet to process by the letter of the column and the number of the first row containing the data.
<o:p></o:p>
The code so far:
<o:p></o:p>
Sub frequency()<o:p></o:p>
<o:p></o:p>
Dim FirstRow As Integer<o:p></o:p>
FirstRow = InputBox(prompt:="FirstRow", Default:=18)<o:p></o:p>
<o:p></o:p>
Dim DataCol As String<o:p></o:p>
DataCol = InputBox(prompt:="Data Column", Default:="b")<o:p></o:p>
<o:p></o:p>
Dim MaxBin As Integer<o:p></o:p>
MaxBin = InputBox(prompt:="Max Bin", Default:=200)<o:p></o:p>
<o:p></o:p>
Dim BinWidth As Integer<o:p></o:p>
BinWidth = InputBox(prompt:="BinWidth", Default:=10)<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
End Sub
<o:p></o:p>
My question is, how could I use the frequency function in the code with the above variables and display the results in the original sheet?
<o:p></o:p>
Any hint would be greatly appreciated!
<o:p></o:p>
Thanks!
<o:p></o:p>
Jazztech
<o:p></o:p>
<o:p></o:p>
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Previously I was spoiled with quick and brillinat answers. But this time nobody is there to point me to the right directions..?

Please, please!

Jazztech
 
Upvote 0

Forum statistics

Threads
1,214,632
Messages
6,120,652
Members
448,975
Latest member
sweeberry

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