Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am creating a spreadsheet that Loops through a series of continuous row,
assiging a variant variable, V(i), a specific value based on the text within the respective cell. I then want to take the mode of all V(i) values. I have already set up the code so it will set v(i) and tested it so I know it works but when I try to calculate the mode I get errors. I have tried using cells(1,1).value=application.mode(v) and cells(1,1)=application.mode(v) but it always returns a #N/A in the cell. Is there a different function I should be using? Below is some example of my code: Dim V() as variant Select Case LCase(cell.Text) Case "once a month" V(i) = 0.25 Case "one time a month" V(i) = 0.25 Case Else If Application.CountA(cell.Resize(1, 5)) = 0 Then V(i) = False Else V(i) = Application.CountA(cell.Resize(1, 5)) End If End Select Cells(CurrentRow + 2, CurrentColumn) = Application.Mode(V) Cells(CurrentRow + 2, CurrentColumn).Resize(1, 5).Merge Thanks for the Help, Scott |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
MODE calc where more than one mode number! | New Users to Excel | |||
Combo Box goes to edit mode even if design mode is in OFF position | Excel Discussion (Misc queries) | |||
coverting answer from Radian mode to degree mode | Excel Worksheet Functions | |||
macro to close excel application other than application.quit | Excel Programming | |||
Enter Excel Design Mode and Exit Design Mode | Excel Programming |