LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions,microsoft.public.access.queries,microsoft.public.excel.programming
ANE ANE is offline
external usenet poster
 
Posts: 1
Default Using Excel WorksheetFunction.Mode function in Access VBA

Hi-

I would like to use the Excel Application Worksheet Mode function
in Access. Is it possible? I know that the following code works:

set the reference to microsoft excel library

Sub xlMedian()
Dim obj As Excel.Application
Set obj = CreateObject("Excel.Application")
MsgBox obj.Application.Median(1, 2, 5, 8, 12, 13, 1, 1)
obj.Quit
Set obj = Nothing
End Sub

However, if I replace Median with Mode I get an error: "Type Mismatch"


If I try WorksheetFunction.Mode(1, 2, 5, 8, 12, 13, 1, 1)
With Sheets("Sheet1")
MsgBox WorksheetFunction.Mode(.Range(.Range("F2"), .Range("G2")))
End With

I receive the message
"unable to get the Mode property of the WorksheetFunction class"


I am very new to writing Excel VBA code. The answer maybe obvious,
however, searching for it seems to be a time sink!

Is it possible to do this without setting the ActiveCell formula.?

-Thanks so much.

ANE
 
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 function in excel using Text johnskate17 Excel Discussion (Misc queries) 6 April 18th 13 07:11 PM
Mode Function or MODE Function -- Can't get it to work!! JoAn Excel Discussion (Misc queries) 5 November 4th 09 12:08 AM
how to get write access from read-onlly mode Maus Excel Discussion (Misc queries) 1 August 14th 09 05:04 PM
3D References Mode() Function Excel the-big-john[_2_] Excel Worksheet Functions 1 March 14th 07 09:30 PM
how do I end function mode in excel Goose Excel Discussion (Misc queries) 1 February 17th 06 02:46 PM


All times are GMT +1. The time now is 01:33 PM.

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"