Silly question

K

ksnapp

If I can find somthing like the worksheet function frequency in th
object browser I should be abble to use it right.

i use application.worksheetfunction.frequency and vba give me a ru
time error 1004 unable to get frequency property from worksheetfunctio
class.

is this normal or am I doin somethin wrong
 
K

ksnapp

Sub frequency_helper()

Dim LRindex As Single
Dim ColumnToWork As Single
Dim namerow As Single
Dim interm As Long
Dim Rng1 As Range
Dim LCdata As Single
Dim name As String
Dim DayNumber As Single
Dim col1 As New Collection

DayNumber = 1
ColumnToWork = 2

Worksheets("frequency").Select
With Worksheets("frequency")

name = Cells(2, ColumnToWork).Value

LRindex = Cells(Rows.Count, "A").End(xlUp).Row
End With

Worksheets("zscore").Select
With Worksheets("zscore")
Range("a2:a16").Select
For Each cell In Selection
If cell.Value = name Then
namerow = cell.Row
End If
Next

LCdata = Cells(3, Columns.Count).End(xlToLeft).Columns
Range("a3", Cells(3, LCdata)).Select

For Each cell In Selection
If cell.Value = DayNumber Then
interm = cell.Column
col1.Add (Cells(namerow, interm).Value)
End If
Next

End With

Worksheets("frequency").Select
With Worksheets("frequency")
Set Rng1 = Range(Cells(3, 1), Cells(LRindex, 1))

Range(Cells(3, ColumnToWork), Cells(LRindex, ColumnToWork)).Select

Selection.Value = Application.WorksheetFunction.Frequency(col1, Rng1)

End With



MsgBox (name)
MsgBox (namerow)

End Su
 
F

Frank Kabel

Hi
though not tested I assume that the usage of a collection object for
Frequency is not allowed
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top