+ Reply to Thread
Results 1 to 8 of 8

Calendar VBA auto filling week and month based on calendar entry.

  1. #1
    Registered User
    Join Date
    09-01-2009
    Location
    southampton
    MS-Off Ver
    Excel 2007
    Posts
    32

    Calendar VBA auto filling week and month based on calendar entry.

    Hi there.

    i have the attached form which is pretty much finsihed however i have one thing left to do.

    i have added a calendar for the users to use to log the date they make the data entry. that works fine.

    below the calendar i have a week and month text box. I would like these boxes to be populated automatically based on the information "date parameters" sheet,

    so for example if the user chooses 19/01/2012 in the calendar, the week box will show 3 and the month will show Jan.

    Distributions 2012.xls

    many thanks

    Matt

  2. #2
    Valued Forum Contributor
    Join Date
    03-17-2007
    Location
    Michigan
    MS-Off Ver
    Excel 2016
    Posts
    957

    Re: Calendar VBA auto filling week and month based on calendar entry.

    Hello Matt,

    I'm not that knowledgeable with vba to assist you with your particular calendar example to help with what you are trying to accomplish. I do however have a sample of a calendar I use in a workbook of mine, which does put a date in a text box which is picked from a calendar similar to yours. I've attached a very stripped down version of my workbook so that you can see the userform and calendar example. When you enable the macros for this sheet you'll be prompted with a login/password window; use "pawn" in each field to allow you access. Afterwards another userform will display and you'll see a text field titled "date of transaction", which to the immediate right of it will be a calendar icon. Click on that icon and the calendar will appear for you to select a date. Once you click on the specific month & day, the date will then transpose in the text field. I'm hoping that maybe you'll be able to use similar coding to possibly use in your workbook. Anyway, I hope this helps!
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    09-01-2009
    Location
    southampton
    MS-Off Ver
    Excel 2007
    Posts
    32

    Re: Calendar VBA auto filling week and month based on calendar entry.

    hi there, thanks for your reply however i have that functionality at the moment. appreciate your effort though.

  4. #4
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Calendar VBA auto filling week and month based on calendar entry.

    If first of Jan for a year is say thursday how do calculate first week.
    What i mean is in this what are the dates of Week No. 1. (1/1/Yr to 5/1/Yr or something else).
    Hope you have followed my doubt.

  5. #5
    Registered User
    Join Date
    09-01-2009
    Location
    southampton
    MS-Off Ver
    Excel 2007
    Posts
    32

    Re: Calendar VBA auto filling week and month based on calendar entry.

    hi, if you look at my original attached file i have a lsit of dates with corresponding week numbers and months.

    i need to somehow link the date entered in the form (by using the calendar) to the week numbers and months i have specified.

    thanks

  6. #6
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Calendar VBA auto filling week and month based on calendar entry.

    Pl see the attached file.Clarifications welcome.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    09-01-2009
    Location
    southampton
    MS-Off Ver
    Excel 2007
    Posts
    32

    Re: Calendar VBA auto filling week and month based on calendar entry.

    thanks mate, i will check when i get home as i cant download file from work.

    fingers crossed.

  8. #8
    Registered User
    Join Date
    09-01-2009
    Location
    southampton
    MS-Off Ver
    Excel 2007
    Posts
    32

    Re: Calendar VBA auto filling week and month based on calendar entry.

    hi there. i have just checked and im afraid it does not quite do what i need it to. the week numbers must match with the dates in the date parameters sheet. at the moment if i click on 30th jan 2012 its saying that its month of jan and week 6. if you look at the date parameters sheet this date should give me week 5 and the month of feb.

    also i would like it to say the month and not a number.

    thanks for your efforts but still need some assistance.

    thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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