Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 143
Default Problem using Day() in a macro

I am trying to use the Day() function in a macro using a line like this

intLastDay = Application.WorksheetFunction.Day(date as a serial)

But VBA does not seem to recognize Day() as a worksheetFunction
Anybody has an idea why?

PS I am using Excel 2007
--
Marie
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Problem using Day() in a macro

Because VBA has its own Day() function.

intlastday = day(mydate)



Marie wrote:

I am trying to use the Day() function in a macro using a line like this

intLastDay = Application.WorksheetFunction.Day(date as a serial)

But VBA does not seem to recognize Day() as a worksheetFunction
Anybody has an idea why?

PS I am using Excel 2007
--
Marie


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Problem using Day() in a macro

Hi,

You don't need to use the Day() worksheetfunction because VB has its own
day() function.

MyDay = Day(MyDate)

Mike

"Marie" wrote:

I am trying to use the Day() function in a macro using a line like this

intLastDay = Application.WorksheetFunction.Day(date as a serial)

But VBA does not seem to recognize Day() as a worksheetFunction
Anybody has an idea why?

PS I am using Excel 2007
--
Marie

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
Problem with macro Dave Excel Discussion (Misc queries) 3 October 22nd 07 06:30 PM
Macro Problem Angel_24477616 Excel Worksheet Functions 2 March 9th 07 11:28 AM
Macro problem [email protected] Excel Discussion (Misc queries) 6 January 2nd 07 09:22 PM
macro problem hombreazul Excel Discussion (Misc queries) 2 March 16th 06 10:54 PM
macro problem Kevin Excel Discussion (Misc queries) 1 December 14th 04 10:47 PM


All times are GMT +1. The time now is 08:11 AM.

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"