+ Reply to Thread
Results 1 to 12 of 12

Userform Start and End Date Populating Results Sheet

  1. #1
    Registered User
    Join Date
    11-13-2018
    Location
    Arizona, USA
    MS-Off Ver
    MS Office 2016
    Posts
    16

    Userform Start and End Date Populating Results Sheet

    Hello! I've been reading your forum for a very long time, and have learned a lot from it, so thank you. Now, I have a project I need help with that I've not been able to find anything on the forum or internet in general about it. (Which makes me wonder if what I'm looking for is even possible...) Here it is (forgive me for the length of my post):

    (I am working with Excel 2010 and 2016 if that matters). I have a .xlsm workbook that I intend to use for my team to request PTO (vacation days). The userform currently has the following fields that are filled in by the user to request PTO:

    1. Name (combo list)
    2. Request Type (combo list)
    3. Start Date (text field)
    4. End Date (text field)
    5. Available PTO hours (text field)
    6. Additional notes (text field)

    Once the user is finished entering all the information, they hit the "save" button. The save button does a couple of different actions:

    1. Sends me an email, so I know a new request has been entered, (so I know to go in and approve or deny it).
    2. Populates the corresponding fields on my "results" sheet.
    3. Then, it clears the userform and closes it, leaving the workbook itself open.

    Action #2 is what I am trying to enhance. Is there a way to code the userform to enter all of the dates being requested on my results form so that I am seeing each individual day on its own separate row? For example, if someone is requesting a start date of "1/2/2019" and an end date of "1/4/2019" - can I get it to populate on three separate rows instead of just one? So I would see three requests from this employee for 1/2, 1/3, and 1/4.

    Please let me know if this makes sense - I can post a copy of what I have if you need to see it! And thank you in advance for any assistance you can give me!
    Attached Images Attached Images

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,938

    Re: Userform Start and End Date Populating Results Sheet

    Hi and welcome

    I'm sure this is possible and not too difficult.
    Would be a lot easier to help if we could see the file though.

    BSB

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Userform Start and End Date Populating Results Sheet

    When the 3 rows are added are all of columns B:I exactly the same? i.e. no change to the userform is needed?

    If you upload the workbook it should be a simple thing to change.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Registered User
    Join Date
    11-13-2018
    Location
    Arizona, USA
    MS-Off Ver
    MS Office 2016
    Posts
    16

    Re: Userform Start and End Date Populating Results Sheet

    Sorry, I'm trying to figure out how to attach the file... I'm not seeing an "add attachment" button

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Userform Start and End Date Populating Results Sheet

    Yes I agree. The Attach icon does not work

    Use the Go Advanced button on the bottom right, then underneath the post area look for Manage Attachments and take it from there.

  6. #6
    Registered User
    Join Date
    11-13-2018
    Location
    Arizona, USA
    MS-Off Ver
    MS Office 2016
    Posts
    16

    Re: Userform Start and End Date Populating Results Sheet

    Here is my file...
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    11-13-2018
    Location
    Arizona, USA
    MS-Off Ver
    MS Office 2016
    Posts
    16

    Re: Userform Start and End Date Populating Results Sheet

    Quote Originally Posted by Richard Buttrey View Post
    When the 3 rows are added are all of columns B:I exactly the same? i.e. no change to the userform is needed?

    If you upload the workbook it should be a simple thing to change.
    Hi Richard - as far as the columns being the same - yes, that's what I'm thinking, but if they can't be, I could work with that also.

  8. #8
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Userform Start and End Date Populating Results Sheet

    Hi,

    I only asked about the columns being the same since i couldn't see what information on the form could distnguish them. The loop counter could be used as a unique identifier if necessary.

    Here's the amended / additonal code

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    11-13-2018
    Location
    Arizona, USA
    MS-Off Ver
    MS Office 2016
    Posts
    16

    Re: Userform Start and End Date Populating Results Sheet

    Thank you, Richard ... I got a couple of compile errors for "variable not defined" - I figured that out (some of the code was showing "lrow" and some was "lrows") so I updated those to "lrow" instead, then I was able to get through the process of entering my information in the form and hitting save. But, the first request I made populated 30 rows of identical data (I was only requesting 4 days of PTO)... then the second request I made (for 2 days of PTO), returned 60 rows of identical data.

    I was hoping to have only the number of days being requested match the number of rows being populated. Is there another tweak you can think of to do that? But, we're definitely on the right path!!

  10. #10
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Userform Start and End Date Populating Results Sheet

    You had already created a lRow variable to establish the next available row.
    I added another called lRows which determines the number of rows to add.
    That's the
    Please Login or Register  to view this content.
    line of code whih deducts the start date from the end date.

    If you altered the code then no doubt that caused the problem

    I've attached the copy I used.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    11-13-2018
    Location
    Arizona, USA
    MS-Off Ver
    MS Office 2016
    Posts
    16

    Re: Userform Start and End Date Populating Results Sheet

    Perfect!!! That's exactly what I was looking for - thank you so much Richard, I really appreciate your help!!

  12. #12
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Userform Start and End Date Populating Results Sheet

    My pleasure and thanks for the rep.

+ 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] Populating dates below a start date
    By Ksun23 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 01-22-2018, 12:45 AM
  2. [SOLVED] Populating userform textboxes basis of results from 2 userform comboboxes
    By rlh in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-11-2017, 10:26 AM
  3. Populating cells in planning according to start and end date
    By frencholivier in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-27-2015, 11:01 AM
  4. Replies: 4
    Last Post: 08-29-2014, 09:57 AM
  5. [SOLVED] Populating A Matrix from results sheet
    By Foreverlearning in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 03-30-2012, 04:41 PM
  6. Populating column with dates based on start and end date
    By mdavid800 in forum Excel General
    Replies: 5
    Last Post: 08-07-2011, 12:49 PM
  7. Populating UserForm TextBoxes from ListBox results
    By AGrace in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-15-2010, 03:07 PM

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