Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default Application.WorkSheetFunction.DafeDif (not DateDiff)

Am I doing this wrong? Or, can I not call DateDif from vb? I don't want to use datediff because it doesn't give real time. Ie: the months start on the first, not on the day of month chosen. Is there a better way w/o having to open a worksheet to get the data

Sub AccFreeTime(
Dim AccDayTime As Dat
Dim Result As Varian
Result = Application.WorksheetFunction.DateDif(AccDayTime, NOW(), "ym"
MsgBox (Result
End Su

Thanks in advance for any/all assistance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Application.WorkSheetFunction.DafeDif (not DateDiff)

Rick,

You can't use the DATEDIF worksheet function in VBA.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"Rick" wrote in message
...
Am I doing this wrong? Or, can I not call DateDif from vb? I

don't want to use datediff because it doesn't give real time.
Ie: the months start on the first, not on the day of month
chosen. Is there a better way w/o having to open a worksheet to
get the data?

Sub AccFreeTime()
Dim AccDayTime As Date
Dim Result As Variant
Result = Application.WorksheetFunction.DateDif(AccDayTime,

NOW(), "ym")
MsgBox (Result)
End Sub

Thanks in advance for any/all assistance.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Application.WorkSheetFunction.DafeDif (not DateDiff)

On Thu, 8 Jan 2004 03:56:12 -0800, "Rick"
wrote:

Am I doing this wrong? Or, can I not call DateDif from vb? I don't want to use datediff because it doesn't give real time. Ie: the months start on the first, not on the day of month chosen. Is there a better way w/o having to open a worksheet to get the data?

Sub AccFreeTime()
Dim AccDayTime As Date
Dim Result As Variant
Result = Application.WorksheetFunction.DateDif(AccDayTime, NOW(), "ym")
MsgBox (Result)
End Sub

Thanks in advance for any/all assistance.


Datedif is not in the list of worksheet functions available to VBA, so you
can't use it here.

You would probably have to write a routine that would do exactly what you want.


--ron
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default Application.WorkSheetFunction.DafeDif (not DateDiff)

Thanks guys. Now I know where not to start.
Reply
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
Reuse Application.WorksheetFunction jlclyde Excel Discussion (Misc queries) 4 March 12th 09 08:32 PM
Application.WorksheetFunction error Ayo Excel Discussion (Misc queries) 4 May 16th 08 05:04 PM
Need help with Application.WorksheetFunction Ayo Excel Discussion (Misc queries) 4 May 14th 08 11:13 PM
application.worksheetfunction.mmult help Alex[_13_] Excel Programming 2 October 29th 03 10:13 PM
Using Application.WorksheetFunction.Ln(...) in VBA doco Excel Programming 4 August 25th 03 01:08 PM


All times are GMT +1. The time now is 07:10 PM.

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

About Us

"It's about Microsoft Excel"