Vba to return week numbers in Excel
Has anyone any idea how to get VBA to give the current week number?
I know i can use the analysis toolpak in excel but i need this form I'm creating to give me the correct week number even if the analysis toolpak isn't installed on a machine. does anyone know of a workaround?
Here the code to do this. Other examples on the following link
Function VBAWeekNum(D As Date, FW As Integer) As Integer
VBAWeekNum = CInt(Format(D, "ww", FW))
(for formulas, depending on your country, you might have to change ; with , or the opposite