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 (No Ratings Yet)
Loading ... Loading ...


Incoming excel search terms

vba date functions,excel datepart,excel current week,vba week,datepart macro excel,datepart excel,excel vba current week,excel vba datepart,excel vba dayofweek,excel vba week number,0,current week excel,current week in excel,datepart excel marco,datepart macro,excel vba datepart function,vba excel week number,calculate previous week vba,current week excel vba,datepart function in excel,datepart vba,datepart vba excel,excel datepart function,excel macro find day of week,excel vba date functions,excel vba day of week from date,excel week of month,get beginning of week excel vba,mss,using vba to name new sheet with monday week starting date,vba date week,vba day of week,vba get the date of monday in the current week,vba to insert sheets by week,week function in excel,week function vba,week vba,excel macros vba date passed,,1-52 to weeks excel,1h,52 week excel formula,52 week in excel sheet,active datepart vba excel macro,allintext:get week of current month vba,beginning week excel,calculate weeks in month in vba,calculate which week does a date represent in excel macros,calculating days with datepart vba excel,create datepart function in excel



Related Excel Tips

Comments

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