Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default VBA - number of monthdays ...

Hello!

I would like to change the follwoing command:

dbentry = Day(DateSerial(Year(Date), Month(Date) + 1, 0))
* 24

Excel should take the number of days of the month "two
days ago" (e.g. today is March 2nd, Excel should take
number of days in February). My problem is that data from
the previous month needs to be calculated on 1st and 2nd
of the current month ...

Can anybody help?

Thank you,
Mirja
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,440
Default VBA - number of monthdays ...

Hi Mirja,

Just leave out the "+1"

--

Kind Regards,

Niek Otten

Microsoft MVP - Excel

"Mirja" wrote in message
...
Hello!

I would like to change the follwoing command:

dbentry = Day(DateSerial(Year(Date), Month(Date) + 1, 0))
* 24

Excel should take the number of days of the month "two
days ago" (e.g. today is March 2nd, Excel should take
number of days in February). My problem is that data from
the previous month needs to be calculated on 1st and 2nd
of the current month ...

Can anybody help?

Thank you,
Mirja



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 292
Default VBA - number of monthdays ...

Hi Mirja

Day(DateSerial(Year(Date-2), Month(Date-2) + 1, 0))

You are not multiplying a date by 24 ?

HTH. Best wishes Harald


"Mirja" skrev i melding
...
Hello!

I would like to change the follwoing command:

dbentry = Day(DateSerial(Year(Date), Month(Date) + 1, 0))
* 24

Excel should take the number of days of the month "two
days ago" (e.g. today is March 2nd, Excel should take
number of days in February). My problem is that data from
the previous month needs to be calculated on 1st and 2nd
of the current month ...

Can anybody help?

Thank you,
Mirja



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
Sumif number is greater than a number but less than another number lulu151 Excel Discussion (Misc queries) 2 May 7th 10 07:12 PM
Find number of weekdays and wekend days given a total number of da Juan Correa Excel Discussion (Misc queries) 7 February 19th 10 09:47 PM
How can I click on a telephone number in an Excel 2002 spreadsheet, and have the number dialed? jbclem Excel Discussion (Misc queries) 2 August 13th 09 01:57 AM
How to calculate number of occurencies of a specific number number Stefan Excel Discussion (Misc queries) 4 September 8th 08 08:33 AM
Rounding a number to a multiple quantity that adds to a fixed total number wjlo Excel Worksheet Functions 1 November 9th 04 04:43 PM


All times are GMT +1. The time now is 05:58 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"