+ Reply to Thread
Results 1 to 4 of 4

macro to compare two columns, and then output an answer into a different column.

  1. #1
    Forum Contributor
    Join Date
    05-20-2013
    Location
    Ann Arbor, MI
    MS-Off Ver
    Excel 2010
    Posts
    255

    macro to compare two columns, and then output an answer into a different column.

    Hello,

    I have two columns containing numbers. I need to see if column D <= column F, and if it is, output "on time" into column G
    If column D > column F then output "late" into column G.
    I know I can do this with simple formulas, but I need it to be done through macro.

    Thanks!

    my workbook is attached.
    This is being done on the worksheet, 'Modify Data'
    Attached Files Attached Files

  2. #2
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: macro to compare two columns, and then output an answer into a different column.

    Try this..

    Please Login or Register  to view this content.
    Last edited by Debraj Roy; 07-31-2013 at 12:16 PM.
    Regards!
    =DEC2HEX(3563)

    If you like someone's answer, click the star to give them a reputation point for that answer...

  3. #3
    Forum Contributor
    Join Date
    05-20-2013
    Location
    Ann Arbor, MI
    MS-Off Ver
    Excel 2010
    Posts
    255

    Re: macro to compare two columns, and then output an answer into a different column.

    That works! thanks.
    I had to change "G2:G" to "G3:G"

    Thanks!

  4. #4
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: macro to compare two columns, and then output an answer into a different column.

    Thanks for feedback & 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. Compare the two columns and display the 2nd column item as output
    By gurum in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-25-2013, 07:58 AM
  2. Compare 2 columns near equiv (one has text included) and output to new column
    By CNE5x in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-08-2012, 01:24 PM
  3. Macro to compare two columns and output min/max
    By arpit_rao6 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-03-2010, 01:34 PM
  4. Compare 2 columns and choose one and enter answer in third column
    By Betsy in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-30-2006, 01:20 PM
  5. Compare 2 columns and output to a 3rd column
    By jamaican jewel in forum Excel General
    Replies: 1
    Last Post: 03-22-2006, 05:30 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