Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
WorksheetFunction help Ayo Excel Discussion (Misc queries) 2 July 20th 08 10:48 PM
histograms - frequency and relative frequency? confusedstudent Excel Discussion (Misc queries) 2 February 8th 06 08:20 AM
worksheetfunction GMet Excel Programming 2 September 27th 04 05:36 PM
Worksheetfunction Fred Smith Excel Programming 5 May 14th 04 01:11 AM
WorkSheetFunction.CountIf & WorkSheetFunction.SumIf with 2 conditions? Etien[_2_] Excel Programming 3 January 13th 04 04:07 PM


All times are GMT +1. The time now is 01:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"