+ Reply to Thread
Results 1 to 3 of 3

Userform, fill Textbox with calender week (ww) depending on date from another TextBox

  1. #1
    Registered User
    Join Date
    06-12-2012
    Location
    Wichita, Kansas
    MS-Off Ver
    Excel 2010, 2016, 2021-22
    Posts
    87

    Userform, fill Textbox with calender week (ww) depending on date from another TextBox

    I have a text box that populates "dd/mm/yyyy" on a button press. Is there a way to populate the next text box with that dates calender week "ww" where it changes dynamically?

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,855

    Re: Userform, fill Textbox with calender week (ww) depending on date from another TextBox

    There are few ways to calculate week number from date.

    Which standard are you using? Excel standard WEEKNUM function, ISOWEEKNUM function, or other variation? And what day of week is start of week? Monday/Sunday?
    Note: ISOWEEKNUM is not available in Excel 2010 (introduced on Excel 2013) and always uses Monday as first day of week.

    ISOWEEKNUM will account for week crossing over one year to next. Ex: 1/1/2021 will belong to Week 53 of 2020. Where as WEEKNUM(date,2) will give first 3 days of 2021 as week 1 of 2021.

    At any rate, I'd recommend that you calculate calendar week at same time as you fill the text box on button press. Using DateSerial(year, month, day) function along with Application.ISOWEEKNUM or WEEKNUM.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  3. #3
    Registered User
    Join Date
    06-12-2012
    Location
    Wichita, Kansas
    MS-Off Ver
    Excel 2010, 2016, 2021-22
    Posts
    87

    Re: Userform, fill Textbox with calender week (ww) depending on date from another TextBox

    I took your advice and calculated the week at the same time and ended up with this
    Please Login or Register  to view this content.
    That seems to do the job, but without the dynamic changing. I could live with that.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Fill a textbox with varaible text depending on Radio Button selection combo
    By aprilnparker in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 08-29-2018, 06:27 AM
  2. [SOLVED] Trying to fill textbox depending on the combobox value
    By Rekragisao in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-23-2017, 11:12 AM
  3. [SOLVED] Need to define a textbox in a userform as a date field with the day of the week
    By katiedee1625 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-02-2016, 03:24 PM
  4. [SOLVED] Excel 2010 - Userform - display date from textbox in a label or textbox in 'ddd' format
    By theshybutterfly in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-29-2015, 10:54 PM
  5. [SOLVED] Fill a cell via textbox on userform depending on combobox selection
    By Rhamilton2512 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-15-2012, 10:29 AM
  6. [SOLVED] VBA UserForm - Have entry in TextBox fill Another TextBox by VLOOKUP
    By msquared99 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-26-2012, 10:24 PM
  7. Calender enters date into clicked on textbox
    By Macdave_19 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-03-2008, 05:14 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1