It is currently Mon Sep 06, 2010 7:28 am




Post new topic Reply to topic  [ 2 posts ] 
 Excel - Custom WEEKNUM function (fix for 2010) 
Author Message
Site Admin

Joined: Fri May 29, 2009 10:41 am
Posts: 25
Location: Milton Keynes, UK
Post Excel - Custom WEEKNUM function (fix for 2010)
The WEEKNUM fuction seems incorrect for 2010. All the calendars at my work start with week 1 on the 4th of jan 2010. How can I correct it?

_________________
Damo


Fri Jan 08, 2010 9:56 am
Profile WWW
Site Admin

Joined: Fri May 29, 2009 10:41 am
Posts: 25
Location: Milton Keynes, UK
Post Re: Excel - Custom WEEKNUM function (fix for 2010)
Here is the code.

Inserting this function into a module of your excel workbook will have priority over the builtin one.

Code:
Function Weeknum(str, Optional num As Variant)
    If IsMissing(num) Then num = 2
    Weeknum = DatePart("ww", str, 2, num)
End Function

_________________
Damo


Fri Jan 08, 2010 9:58 am
Profile WWW
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.