Posted to microsoft.public.excel.programming
|
|
Silly question
Hi
though not tested I assume that the usage of a collection object for
Frequency is not allowed
--
Regards
Frank Kabel
Frankfurt, Germany
"ksnapp " schrieb im
Newsbeitrag ...
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 Sub
---
Message posted from http://www.ExcelForum.com/
|