+ Reply to Thread
Results 1 to 6 of 6

Loop a column on Sheet1 and loop a row on Sheet2 to find a match

  1. #1
    Registered User
    Join Date
    08-21-2007
    Posts
    90

    Loop a column on Sheet1 and loop a row on Sheet2 to find a match

    This is over my head, any help will be appreciated. I looked at 50 posts on loops and am still confused.

    Can I use a Loop to do this or is there a better way? Seems like I am trying to do 2 loops at the same time? Has to be done by VBA code.


    If a value in Sheet("A") D12:D45 equals a value in Sheet("B") G12:BA12),

    then highlight cells in rows 10 to 45 in the column in Sheet("B") where the value matches.


    The values in Sheet("A") are dates (no duplicates) as are the values in Sheet("B").

    Thanks
    Last edited by johnnywinter; 02-13-2009 at 02:03 PM.

  2. #2
    Forum Guru shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,673

    Re: Loop a column on Sheet1 and loop a row on Sheet2 to find a match

    Why VBA? Why not just conditional formatting?
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    08-21-2007
    Posts
    90

    Re: Loop a column on Sheet1 and loop a row on Sheet2 to find a match

    The cells have conditional formatting for color already.

    When I manual use Fill for color, the condtionally formated cells retain their color, which is what I want. (will VBA have the same effect?)

    SHG, am I misunderstanding the use of conditional formatting?
    Last edited by johnnywinter; 02-12-2009 at 11:36 PM.

  4. #4
    Registered User
    Join Date
    08-18-2008
    Location
    Singapore
    Posts
    79

    Re: Loop a column on Sheet1 and loop a row on Sheet2 to find a match

    Do you want to highlight in both sheets? Or just one sheet?

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,202

    Re: Loop a column on Sheet1 and loop a row on Sheet2 to find a match

    If you colour a cell using VBA you will be able to change that colour manually.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  6. #6
    Registered User
    Join Date
    08-21-2007
    Posts
    90

    Re: Loop a column on Sheet1 and loop a row on Sheet2 to find a match

    carddards, just one sheet- I changed the post to be more explanatory.

    If a value in Sheet("A") D12:D45 equals a value in Sheet("B") G12:BA12),

    then highlight cells in rows 10 to 45 in the column in Sheet("B") where the value matches.

+ 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