Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to use worksheetFunction.Frequency
Hi,
I want to use the worksheetFunction.frequency function in VBA to generate a frequency list of data. I don't know how to return the result into the spreadsheet.Manually, I can do it with an array function. sub test() set myBin = Range("A1:A10") set myData= Range("C1:D20") ?? = WorksheetFunction.Frequency(myData, myBinRange) End sub Any help? Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to use worksheetFunction.Frequency
Hi Peter,
Try: Sub test() Dim arr() Dim sh As Worksheet Dim myBin As Range, myData As Range Set sh = Sheets("Sheet1") '<<==== CHANGE With sh Set myBin = .Range("A1:A10") Set myData = .Range("C1:D20") arr = WorksheetFunction.Frequency(myData, myBin) .Range("F1").Resize(UBound(arr) - LBound(arr)) = arr End With End Sub Change the sheet name and change F1 to suit. --- Regards, Norman "Peter Janssens" wrote in message ... Hi, I want to use the worksheetFunction.frequency function in VBA to generate a frequency list of data. I don't know how to return the result into the spreadsheet.Manually, I can do it with an array function. sub test() set myBin = Range("A1:A10") set myData= Range("C1:D20") ?? = WorksheetFunction.Frequency(myData, myBinRange) End sub Any help? Thanks. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to use worksheetFunction.Frequency
Thanks, works like a breeze!
"Norman Jones" schreef in bericht ... Hi Peter, Try: Sub test() Dim arr() Dim sh As Worksheet Dim myBin As Range, myData As Range Set sh = Sheets("Sheet1") '<<==== CHANGE With sh Set myBin = .Range("A1:A10") Set myData = .Range("C1:D20") arr = WorksheetFunction.Frequency(myData, myBin) .Range("F1").Resize(UBound(arr) - LBound(arr)) = arr End With End Sub Change the sheet name and change F1 to suit. --- Regards, Norman "Peter Janssens" wrote in message ... Hi, I want to use the worksheetFunction.frequency function in VBA to generate a frequency list of data. I don't know how to return the result into the spreadsheet.Manually, I can do it with an array function. sub test() set myBin = Range("A1:A10") set myData= Range("C1:D20") ?? = WorksheetFunction.Frequency(myData, myBinRange) End sub Any help? Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
WorksheetFunction help | Excel Discussion (Misc queries) | |||
histograms - frequency and relative frequency? | Excel Discussion (Misc queries) | |||
worksheetfunction | Excel Programming | |||
Worksheetfunction | Excel Programming | |||
WorkSheetFunction.CountIf & WorkSheetFunction.SumIf with 2 conditions? | Excel Programming |