Although I'm not sure how to write code for this.Įdit: The purpose of this macro is to automatically name the output as I am going to automate the rest of the report. If the it is more than 4 and all 4 happen to be in the next month then I would use that month's name, otherwise the current one. In theory I would count how much days do I have on the given week (before Friday), if its less than 4, then I would use the week number for the previous week. NextFriday = Now() + 1 - Weekday(Now(), 6) PreviousSaturday = Now() - 7 - (Weekday(Now(), 1)) What I have so far is (not much): sub CustomWeekNumbering() I hope you get the logic with the help of this table. If you have more than 3 day on a certain week than you will refer to than one. hi all, Has anyone any idea how to get VBA to give the current week number I know i can use the analysis toolpak in. I have to determine the Week number and the month for each report, in each month weeks number starts from 1. For more information and a workaround, see Format or DatePart functions can return wrong week number for last Monday in Year. start date: Saturday before previous FridayĮdit: this week (23rd) I would report for 26/05 - 01/06 The last Monday in some calendar years can be returned as week 53 when it should be week 1. I have a report which has to be done on each Tuesday with a date range of: They are identifiable with a special user flair.Ī community since MaAsking a question? Describe if you are using Excel (include version and operating system!), Google Sheets, or another spreadsheet application. Occasionally Microsoft developers will post or comment. Recent ClippyPoint Milestones !Ĭongratulations and thank you to these contributors Date Include a screenshot, use the tableit website, or use the ExcelToReddit converter (courtesy of u/tirlibibi17) to present your data. NOTE: For VBA, you can select code in your VBA window, press Tab, then copy and paste that into your post or comment. Value + 6, dd/mm/yyyy) End Sub I am working with a 10 week roster I am trying. To keep Reddit from mangling your formulas and other code, display it using inline-code or put it in a code-block Here are a number of highest rated Populate Combo Box Vba pictures upon. This will award the user a ClippyPoint and change the post's flair to solved. OPs can (and should) reply to any solutions with: Solution Verified Only text posts are accepted you can have images in Text posts.Use the appropriate flair for non-questions.Post titles must be specific to your problem If you want start and end dates of current week Mon-Sun try these Code: Sub StartEndDate () MsgBox Date - WorksheetFunction.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |