+ Reply to Thread
Results 1 to 7 of 7

Compare and check header values based on given criteria.

  1. #1
    Forum Contributor
    Join Date
    09-21-2009
    Location
    Belgium - Mechelen
    MS-Off Ver
    Office 365 - version 2310
    Posts
    278

    Compare and check header values based on given criteria.

    Hi there,

    It has been a while ago that i needed to code in Excel.
    not being an expert, i need some help.

    I'd like to check if certain header values are correct in the header row (row A1)

    For example : columns (1, 4, 7 , 10) need to be checked for values (Date, Address, Mobile, Hardware)


    How can i achive this with VBA code ?
    I was thinking of 2 arrays and looping through them to compare the header value and the array value.

    Thanks for helping.
    Attached Files Attached Files
    Even a little help can be a big help !!
    1. A sample workbook says more then words. Add problem description and solution so we can understand the problem.
    2. Your appreciation is accepted by clicking the star "Add Reputation" at the lower left of the post.
    3. If your problem is solved, mark it as [SOLVED]: See "FAQ : " https://www.excelforum.com/faq.php
    4. Use [CODE] [/CODE] tags to illustrate your code: see here

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,318

    Re: Compare and check header values based on given criteria.

    How about as a starter...

    Please Login or Register  to view this content.
    HTH
    Regards, Jeff

  3. #3
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Hi, try this !


    Quote Originally Posted by MarMo View Post
    columns (1, 4, 7 , 10) need to be checked for values
    (Date, Address, Mobile, Hardware)
    According to your attachment a VBA demonstration for starters :
    Please Login or Register  to view this content.
    ► Do you like it ? ► So thanks to click on bottom left star icon « Add Reputation » !

  4. #4
    Forum Contributor
    Join Date
    09-21-2009
    Location
    Belgium - Mechelen
    MS-Off Ver
    Office 365 - version 2310
    Posts
    278

    Re: Compare and check header values based on given criteria.

    Hi Jeff,

    Thanks for the reply.
    Just tested the code, and it works fine for me.

    Regards,
    Mario
    Last edited by MarMo; 11-22-2023 at 05:47 AM.

  5. #5
    Forum Contributor
    Join Date
    09-21-2009
    Location
    Belgium - Mechelen
    MS-Off Ver
    Office 365 - version 2310
    Posts
    278

    Re: Hi, try this !

    Hi Marc L,

    Merci beaucoup.

    Thans for the reply.
    Just tested the code, and works fine.
    Especially the speaking voice is a funny feature.

    Regards,
    Mario

  6. #6
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,318

    Re: Compare and check header values based on given criteria.

    Hi Mario, Glad we could offer you a couple of solutions.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  7. #7
    Forum Contributor
    Join Date
    09-21-2009
    Location
    Belgium - Mechelen
    MS-Off Ver
    Office 365 - version 2310
    Posts
    278

    Re: Compare and check header values based on given criteria.

    Hi Jeff,

    I'll put the thread to [SOLVED]

    I'm aware of the Add Reputation stars, and i added these for both of you when i replied.
    So the appreciation star should be there.

    Kind Regards,
    Mario

+ 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. Check each element of an array based on criteria and update necessary values
    By sabha in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-09-2021, 02:29 AM
  2. Replies: 4
    Last Post: 09-04-2020, 03:10 AM
  3. Replies: 3
    Last Post: 01-18-2016, 10:18 AM
  4. Using < and > to compare date values, check checkboxes based on outcome
    By puffo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-09-2014, 08:29 AM
  5. [SOLVED] Compare a string of values to a specific of value and return the header
    By huy_le in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-19-2013, 10:02 PM
  6. Select multiple criteria based on check box selection and return all unique values.
    By TommyToe in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-21-2013, 09:14 AM
  7. [SOLVED] compare cell value with range of values and match row values with header
    By bujji1305 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-08-2012, 12:19 AM

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