+ Reply to Thread
Results 1 to 6 of 6

Using VBA to change a value in one column based on another

  1. #1
    Registered User
    Join Date
    09-15-2014
    Location
    QLD Australia
    MS-Off Ver
    2010
    Posts
    18

    Using VBA to change a value in one column based on another

    So I have my worksheet that has some dates on it - namely date response due.
    There is a column which indicates the status of an application for a business: application received, active, and inactive.

    I already have it set up that overdue application are highlighted in red, but I was also looking for a macro which would change the text in the status column to OVERDUE when the due date is reached and passed.

    I was wondering what would be the best way to code this.

    Something along the lines of --> search column K by row. If the date is less than today then change the value in column D to OVERDUE.

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,432

    Re: Using VBA to change a value in one column based on another

    .
    Paste this formula in D2 and drag down the column as far as required.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    09-15-2014
    Location
    QLD Australia
    MS-Off Ver
    2010
    Posts
    18

    Re: Using VBA to change a value in one column based on another

    Quote Originally Posted by Logit View Post
    .
    Paste this formula in D2 and drag down the column as far as required.

    Please Login or Register  to view this content.

    This didn't work out for me, applying the formula over existing entries removes them (anything nnot overdue becomes a blank cell, remembers, items are already labelled as received, active, or inactive)
    If the formula is applied first, and then an entry is made, it messes up the conditional formatting and does not work.

    I was looking for a vba macro specifically to avoid issues with cell forumlas.

  4. #4
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,432

    Re: Using VBA to change a value in one column based on another

    .
    Paste this macro into a Routine Module :

    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    09-15-2014
    Location
    QLD Australia
    MS-Off Ver
    2010
    Posts
    18

    Re: Using VBA to change a value in one column based on another

    Quote Originally Posted by Logit View Post
    .
    Paste this macro into a Routine Module :

    Please Login or Register  to view this content.

    Thankyou this is exactly what I was looking for, I did a little bit of editing to have it initiate when the workbook opens

  6. #6
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,432

    Re: Using VBA to change a value in one column based on another

    .
    Glad it works. You are welcome.

+ 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] Sum of one column, but the numbers being calculated could change based on another column
    By ciresuark in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-10-2016, 07:38 PM
  2. Replies: 3
    Last Post: 12-16-2015, 05:56 PM
  3. Need Help - Automatic website navigation page change based on column data change
    By cbatten01 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-10-2015, 08:00 PM
  4. [SOLVED] Need a formula to change cell in column 2 based off of text in column 1
    By bevwalker in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-30-2014, 03:26 PM
  5. [SOLVED] Change all matching Value based on number change in Column Excel 2007
    By Excelnoub in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 02-20-2014, 11:40 AM
  6. Change colour in column C based on Column B - future dates
    By kfwiss in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-22-2013, 05:47 AM
  7. Replies: 4
    Last Post: 09-05-2012, 01:50 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