+ Reply to Thread
Results 1 to 8 of 8

List in Combo Box, when new item is selected put todays date in the adjacent column

  1. #1
    Registered User
    Join Date
    01-20-2014
    Location
    london, England
    MS-Off Ver
    Excel 2010
    Posts
    49

    Thumbs up List in Combo Box, when new item is selected put todays date in the adjacent column

    Hi,

    I have a spread sheet for equipment that gets loaned out on a regular basis. Cells B4 - B25 have combo boxes in them, with the options to select "On Loan", "In Stock Room" etc in them. What I would like to do is create something so that as the combo box is changed, i.e. from "In Stock" to "On Loan", a date changes adjacent to each combo box.

    For example, combo box in B10 has been changed from "In Stock" to "On Loan". The adjacent cell records the date automatically that the combo box was changed.

    Combo box date example.jpg

    Can this be done?

    Thank you for your help on this.
    Last edited by Antligen; 01-20-2014 at 11:59 AM.

  2. #2
    Registered User
    Join Date
    01-07-2014
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    24

    Re: List in Combo Box, when new item is selected put todays date in the adjacent column

    Are you using a ComboBox or just drop down list data validation? If you are using a combobox is it activeX or a form control?

  3. #3
    Registered User
    Join Date
    01-20-2014
    Location
    london, England
    MS-Off Ver
    Excel 2010
    Posts
    49

    Re: List in Combo Box, when new item is selected put todays date in the adjacent column

    At the moment I believe it's a form control combo box. I have two sheets. The selections are on the second sheet like so:

    buttons.jpg

    The button's format controls are set to this:

    combo box.png

    I hope that helps!

  4. #4
    Registered User
    Join Date
    01-20-2014
    Location
    london, England
    MS-Off Ver
    Excel 2010
    Posts
    49

    Re: List in Combo Box, when new item is selected put todays date in the adjacent column

    Sorry, I meant to post my latest comment as a reply! See above for answer

  5. #5
    Registered User
    Join Date
    01-07-2014
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    24

    Re: List in Combo Box, when new item is selected put todays date in the adjacent column

    I have a way to do it. It may be a little obscure but it should work. First open up the VBA editor and add a module. Then you will need to add two subs to it. First off you must format the boxes so they are even and in the right position using the following code. Put both sections of code in your module before continuing.

    Please Login or Register  to view this content.

    Please Login or Register  to view this content.
    The first sub will move all of your drop down boxes into a line starting from row 4 and column B. If you want to change the starting points just change the value of sr or sc. Now you must run the Sub setallshapesizes(). To do this click in between the Sub setallshapesizes() and the end sub and hit F5. After this as long as you have put both sections of code in your module it should work that every time you change a box the date should appear in the cell next to it.
    Last edited by TankBuilder88; 01-21-2014 at 12:38 PM.

  6. #6
    Registered User
    Join Date
    01-20-2014
    Location
    london, England
    MS-Off Ver
    Excel 2010
    Posts
    49

    Re: List in Combo Box, when new item is selected put todays date in the adjacent column

    You are an absolute STAR! That works brilliantly!

    HOWEVER, it updates the date even if I just click on the combobox and not select anything. Is there anyway to amend this? If not I can settle with that :D

    Thanks

  7. #7
    Registered User
    Join Date
    01-07-2014
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    24

    Re: List in Combo Box, when new item is selected put todays date in the adjacent column

    Since you are on excel 2003 I can't quite test this but I believe it should work. Modify your two codes as shown below and run the top one again.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    01-20-2014
    Location
    london, England
    MS-Off Ver
    Excel 2010
    Posts
    49

    Unhappy Re: List in Combo Box, when new item is selected put todays date in the adjacent column

    Sorry for the late response.

    It all works great until you try and add an extra row into the column (new stock is always coming in). I added a row into row 14, now when the new combo box in B14 is changed. I right clicked on all of the boxes and in the Format Control option I have selected the Cell link to be in column Z. For example, Cell B4's cell link is Z4, B12's is Z12 etc. Now when I run the macro, cell B14's combo box puts the date a row above it's adjacent cell. . Is this something to do with the formula, or is this something else?

    Unsure what I have done wrong!
    Last edited by Antligen; 02-03-2014 at 10:38 AM. Reason: spelling error

+ 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. Making The Last Combo Box Item Always The Selected Item
    By abduljaleel.mca in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-09-2013, 10:31 AM
  2. [SOLVED] trying to get cell location of an item selected in a combo box
    By dosage11 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-28-2012, 01:54 AM
  3. Replies: 7
    Last Post: 12-05-2008, 08:36 AM
  4. entering todays date in a selected cell
    By 2newguy in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-12-2007, 11:56 AM
  5. [SOLVED] combo box not showing selected item..
    By nycdon in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-17-2005, 02:05 PM

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