Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Silly question
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 -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Silly question
Hi
could you post the complete code (or at least the relevant part). -- Regards Frank Kabel Frankfurt, Germany "ksnapp " schrieb im Newsbeitrag ... If I can find somthing like the worksheet function frequency in the object browser I should be abble to use it right. i use application.worksheetfunction.frequency and vba give me a run time error 1004 unable to get frequency property from worksheetfunction class. is this normal or am I doin somethin wrong? --- Message posted from http://www.ExcelForum.com/ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Silly question
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 -- Message posted from http://www.ExcelForum.com |
#4
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/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Percentage - How silly I feel asking this question !!! | Excel Discussion (Misc queries) | |||
Silly question | Excel Worksheet Functions | |||
Silly question about using dates | Excel Discussion (Misc queries) | |||
Silly Question | Excel Programming | |||
Simply silly question | Excel Programming |