+ Reply to Thread
Results 1 to 9 of 9

Fill Cells Based on Day of Week Drop Down on VBA Form

  1. #1
    Registered User
    Join Date
    06-15-2014
    Location
    Cuthbert, Ga
    MS-Off Ver
    Office 2013
    Posts
    64

    Fill Cells Based on Day of Week Drop Down on VBA Form

    Okay, I have a challenging one for the genius' on this forum. I hope you guys can help me.

    So I'm tracking the waste of a restaurant on a day to day basis, and I've created a UserForm to make inputting the figures easier, since this is not the only thing tracked on this spreadsheet. The Waste sheet is separated into Days of the Week, Sunday, Monday... etc. I was wondering if it would be possible have the sheet detect the day of week based on the value of a separate cell, and input the values into the day specified. For example, something like (assuming A1 = the day of the week, B1 through B7 are the waste fields and "x" is the value being inserted.)

    If A1 = Monday, then B1 = x
    If A1 = Tuesday, then B2 = x

    So on and so forth...

    And have the coding executed during a button press event.

  2. #2
    Forum Contributor yay_excel's Avatar
    Join Date
    08-12-2011
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    190

    Re: Fill Cells Based on Day of Week Drop Down on VBA Form

    Don't fully understand what you're trying to accomplish, but the VBA code would be something like:
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor yay_excel's Avatar
    Join Date
    08-12-2011
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    190

    Re: Fill Cells Based on Day of Week Drop Down on VBA Form

    Don't fully understand what you're trying to accomplish, but the VBA code would be something like:
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    06-15-2014
    Location
    Cuthbert, Ga
    MS-Off Ver
    Office 2013
    Posts
    64

    Re: Fill Cells Based on Day of Week Drop Down on VBA Form

    Thanks for your help. I've created a cell on a different sheet that specifies the Day of the Week, and created the UserForm. Then based on your suggestion, created the following code. Unfortunately, it doesn't seem to be working. No errors, just not working.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-15-2014
    Location
    Cuthbert, Ga
    MS-Off Ver
    Office 2013
    Posts
    64

    Re: Fill Cells Based on Day of Week Drop Down on VBA Form

    Lol, nevermind, figured it out.... shouldn't have capitalized the days of the week. Thanks for your help!

  6. #6
    Forum Contributor yay_excel's Avatar
    Join Date
    08-12-2011
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    190

    Re: Fill Cells Based on Day of Week Drop Down on VBA Form

    Haha, I puzzled over why that wouldn't be working for awhile before I noticed the second post.

  7. #7
    Registered User
    Join Date
    06-15-2014
    Location
    Cuthbert, Ga
    MS-Off Ver
    Office 2013
    Posts
    64

    Re: Fill Cells Based on Day of Week Drop Down on VBA Form

    You don't supposed there is a way to clean that up and make it all fit in one line of code, do you?

  8. #8
    Forum Contributor yay_excel's Avatar
    Join Date
    08-12-2011
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    190

    Re: Fill Cells Based on Day of Week Drop Down on VBA Form

    You can use Select Case and With...
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    06-15-2014
    Location
    Cuthbert, Ga
    MS-Off Ver
    Office 2013
    Posts
    64

    Re: Fill Cells Based on Day of Week Drop Down on VBA Form

    Thanks for all your help, Rep added.

+ 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. how to fill the non exist data in drop down using vba form excel sheet
    By sateeshkumarj in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-21-2014, 01:27 AM
  2. [SOLVED] Auto fill week days based on month chosen
    By mteeters in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-14-2012, 02:45 PM
  3. [SOLVED] Auto Fill-out Form using Drop Down with Conditions
    By [email protected] in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-26-2012, 03:24 AM
  4. Fill cells based on selection from a drop down on left
    By sa02000 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-17-2011, 04:58 AM
  5. Replies: 1
    Last Post: 10-22-2011, 02:55 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