+ Reply to Thread
Results 1 to 7 of 7

VBA - If selection from list is "Yes" then enter current date into other cell

  1. #1
    Registered User
    Join Date
    07-02-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    8

    VBA - If selection from list is "Yes" then enter current date into other cell

    Scenario: I have multiple tables with different line items that need to be marked "Yes" for approved before they can be purchased - all tables have the same column layout and headings. I need the date of approval to show in corresponding row in another column and for that date to stay. So if the items is approved today and the file is opened tomorrow the date will not change to tomorrows date.

    Specifics: I have an Approval Drop Down list with Yes/No/Pending options in Column G. Need for Column J corresponding row cell to update with current date once "Yes" is specifically selected from Column G, If not I want cells in column J cell to stay blank. Once that date is entered I want the date to not change so that once an item is approved you can look back to see what date it was approved on. I am looking for the specific VBA code that i can place into my worksheet(s).

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,890

    Re: VBA - If selection from list is "Yes" then enter current date into other cell

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    07-02-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    8

    Re: VBA - If selection from list is "Yes" then enter current date into other cell

    Posting attachment
    Last edited by b105; 07-03-2017 at 12:46 PM.

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,890

    Re: VBA - If selection from list is "Yes" then enter current date into other cell

    Put this code in the Worksheet Change Event for the Worksheet you are posting to

    Please Login or Register  to view this content.

  5. #5
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VBA - If selection from list is "Yes" then enter current date into other cell

    Hi b,
    Try this in your sheet module:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  6. #6
    Registered User
    Join Date
    07-02-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    8

    Re: VBA - If selection from list is "Yes" then enter current date into other cell

    Great it works, thank you both for two different options!

  7. #7
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VBA - If selection from list is "Yes" then enter current date into other cell

    You're welcome 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] Column X-Ref list - Sheet1 Col A "pages", Col B:FL "Req" to Sheet2 ColA "req", ColB "page"
    By excel-card-pulled in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 04-07-2017, 09:30 AM
  2. [SOLVED] IF CELL is "Yes" the enter "Enabled" IF CELL is "No" enter "Disabled"
    By king10001 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-10-2016, 09:33 AM
  3. Replies: 6
    Last Post: 03-14-2016, 09:06 AM
  4. [SOLVED] can vba control "when press enter, selection move direction"
    By mrkhchan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-04-2014, 10:56 AM
  5. [SOLVED] How to enter : If "yes", than, set current date
    By jeroenheki in forum Excel Formulas & Functions
    Replies: 26
    Last Post: 10-12-2012, 05:14 AM
  6. Using VBA button to "Save as", add current date & copy cell data.
    By Pedro1803 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-26-2011, 07:56 PM
  7. [SOLVED] Cell Selection after "Enter"
    By Synectica in forum Excel General
    Replies: 6
    Last Post: 08-29-2005, 05:05 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