+ Reply to Thread
Results 1 to 4 of 4

Macro/VBA to populate information based on date selected from data validation list

  1. #1
    Registered User
    Join Date
    03-10-2013
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    6

    Macro/VBA to populate information based on date selected from data validation list

    Hi All,

    I have a workbook created to help a colleague track time spent on various parts of a business for tax purposes. There is a data validation dropdown list composed of a full calendar year of dates. Below that, the user is allowed type in a description of the activity for whatever business entity they performed it for and next to that, they type in the total hours.

    What I am looking for is for a macro or code that will, when they change dates, save information for the date they just typed in and clear the form for the next date. From there, if the user wants to select a date, say, two weeks in the past, the worksheet will automatically populate those cells with the same information they entered from that date in the past. Is this possible?

    I've attached a workbook that gives the general idea. I realize that I could create a sortable lookup table in a different sheet, create dynamic ranges, and then sheet 1 to just automatically pull right from that sheet but I was hoping there might be a way to use VBA to do what I'm asking.

    Thanks much in advance!
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    12-21-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Macro/VBA to populate information based on date selected from data validation list

    see attached is that the solution you was looking for?
    click save data to save new entry into sheet2 and enter a date in cell B5 click lookup to get all the saved entries for that date
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    03-10-2013
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Macro/VBA to populate information based on date selected from data validation list

    Quote Originally Posted by Abhi1687 View Post
    see attached is that the solution you was looking for?
    click save data to save new entry into sheet2 and enter a date in cell B5 click lookup to get all the saved entries for that date
    I think this should do it! I will test it once more in the morning and change this to solved. Thank you for your help!!

  4. #4
    Registered User
    Join Date
    03-10-2013
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Macro/VBA to populate information based on date selected from data validation list

    Thanks again for your help! It is just about what I'm looking for. I'm wondering though, if I wanted to add two columns in sheet two (one for the entity and one for a company car question) so that if, say, on 1/1/2013 I worked on Biz 1,3,5 doing activities x,y,z, when the user selected this date to lookup, it would return activities x,y,z in the related Biz rows....is that possible? And with this code, what would I use to tell the worksheet that, if I select a date with no activity then it should clear the form?

    timetrackingv2.xlsm
    Last edited by anonDymous; 03-12-2013 at 12:03 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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