LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Application.Mode

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
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
MODE calc where more than one mode number! Struggling in Sheffield[_2_] New Users to Excel 2 October 15th 09 04:52 PM
Combo Box goes to edit mode even if design mode is in OFF position Chas Excel Discussion (Misc queries) 0 January 7th 05 07:21 PM
coverting answer from Radian mode to degree mode Xmastrzman Excel Worksheet Functions 1 November 10th 04 04:45 PM
macro to close excel application other than application.quit mary Excel Programming 1 September 14th 04 03:43 PM
Enter Excel Design Mode and Exit Design Mode Bill Lunney Excel Programming 0 August 4th 03 07:48 AM


All times are GMT +1. The time now is 10:19 AM.

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

About Us

"It's about Microsoft Excel"