Week Functions in Vba

March 5, 2009 by vba excel
Filed under: Excel Date Functions 
Sponsor

Excel Date Functions Question:

I got messed up with excel vba date functions, I don’t know if one exists or not, but is there a function in VBA that would return a number representing the week of the year (0-51, or 1-52) when passed a date? its similar to how year() or day() pulls out the year or day portion of a given date?

Excel Date Functions Answer:

-Make sure you have microsoft excel Analysis toolpak addin and use weeknum(now()) to get current week number

-You would use excel DatePart function with “ww” as the 1st argument (with the date as the 2nd argument). There are optional 3rd and 4th arguments which can modify how DatePart functions, and you should look this excel date functions up in the help files (type DatePart and then, with the text caret in or next to the word, hit the F1 key).

  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google
  • E-mail this story to a friend!
  • Live
  • MisterWong
  • Propeller
  • StumbleUpon
  • Technorati
  • TwitThis
  • YahooMyWeb
  • Print this article!

Rate This Tips:

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 4.00 out of 5)
Loading ... Loading ...


Incoming excel search terms

vba date functions,excel vba date functions,excel datepart,excel current week,excel vba week number,vba week,datepart macro excel,mss,,current week in excel,datepart excel,excel vba current week,excel vba datepart,excel vba dayofweek,vba date function,0,current week excel,datepart excel marco,datepart macro,excel datepart function,excel vba date function,excel vba datepart function,excel week of month,vba excel date functions,vba excel week number,vba week number,week function vba,calculate previous week vba,current week excel vba,current week in vba,date functions vba,datepart function in excel,datepart vba,datepart vba excel,excel current week function,excel macro find day of week,excel vba day of week from date,excel vba get date,get beginning of week excel vba,using vba to name new sheet with monday week starting date,vba current week,vba date week,vba datepart,vba day of week,vba day of week from date,vba get the date of monday in the current week,vba to get week number,vba to insert sheets by week,vba week days,vba week function



Related Excel Tips

Comments

Have another excel answer or questions for this problem ?
Feel free to post it here..