+ Reply to Thread
Results 1 to 3 of 3

Comparing Adjacent Columns in excel using vba macros

  1. #1
    Registered User
    Join Date
    04-02-2012
    Location
    hyderabad
    MS-Off Ver
    Excel 2007
    Posts
    6

    Comparing Adjacent Columns in excel using vba macros

    Hi ,

    i would like to have a vba code for comparing two adjacent columns and alert if it meets the codition

    a validate button is provided on excel on clicking it if column "A" is S then column "B" should not be empty and it shoould alert .
    Note : If column A is not S then Column B value can be empty.Here it should alert on 2nd row not on 4th row.

    thanx in advance

    for ex:

    col A col B
    S 01/01/2001
    S
    S 02/02/2002
    B
    B 01/01/2005

  2. #2
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Comparing Adjacent Columns in excel using vba macros

    Something like this, perhaps...

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Comparing Adjacent Columns in excel using vba macros

    Will there be only 1 such occurrence where there is S in col A and a blank in column B? Do you want 1 alert for every such cell? Or do you want a combined messagebox with all such occurrences?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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